Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int v[26];
- int total[26];
- void adaug (int x, int y)
- {
- x%=y;
- for (int i = 1; i<=25; ++i)
- {
- x *= 10;
- total[i] += x/y;
- x %= y;
- }
- for (int i = 25; i >= 1; --i)
- {
- total[i-1] += total[i]/10;
- total[i] %= 10;
- }
- }
- int main()
- {
- ifstream fin ("error.in");
- ofstream fout ("error.out");
- int n;
- long long sus = 0LL, jos = 1LL;
- fin >> n;
- for (int i = 1; i<=n; ++i)
- {
- int x, y;
- fin >> x >> y;
- adaug(x, y);
- }
- for (int i = 1; i<=20; ++i)
- fout << total[i] << ' ';
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement