Skip to content

Commit

Permalink
11689 solved
Browse files Browse the repository at this point in the history
  • Loading branch information
ksaveljev committed Apr 15, 2011
1 parent fcf3003 commit cbb0d6a
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions 11689.cpp
@@ -0,0 +1,29 @@
#include <iostream>
using namespace std;

int main(void) {
int n;
int tmp;
int result;
int e, f, c;

cin >> n;

while (n--) {
cin >> e >> f >> c;

e += f;
result = 0;

while (e >= c) {
tmp = e / c;
result += tmp;
e %= c;
e += tmp;
}

cout << result << endl;
}

return 0;
}

0 comments on commit cbb0d6a

Please sign in to comment.