This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define FOR(i, x, y) for (int i = x; i < y; i++)
typedef long long ll;
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
ll n, m, d;
cin >> n >> m >> d;
if (d == 1 && n % m == 0)
cout << n / m;
else if (d == 3 && n % (3 * m) == 0)
cout << n / (3 * m) * (3 * m + 6 * (m - 1) + 7);
else if (d == 7 && n % (6 * m) == 0) {
// Period: 015873
n /= 6;
} else if (d == 9 && n % (9 * m) == 0)
cout << n / (9 * m) * (36 * m + 1);
else cout << "NESIDALO";
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |