Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- //#include <bits/stdc++.h>
- using namespace std;
- long long sleden_deliv_so_5(long long x) {
- while(x % 5 != 0) {
- x++;
- }
- return x;
- }
- long long prethoden_deliv_so_5(long long x) {
- while(x % 5 != 0) {
- x--;
- }
- return x;
- }
- int main() {
- long long x, y;
- cin >> x >> y;
- long long minimum = ceil(20.0 * x / 19.0);
- long long maksimum = floor(10.0 * x / 9.0);
- if(maksimum > y) {
- maksimum = y;
- }
- if(minimum % 5 != 0){
- minimum = sleden_deliv_so_5(minimum);
- }
- if(maksimum % 5 != 0) {
- maksimum = prethoden_deliv_so_5(maksimum);
- }
- if(minimum > maksimum) {
- cout << 0 << endl;
- }
- else {
- cout << (maksimum - minimum) / 5 + 1 << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement