Dowemo
0 0 0 0

Links to original questions

Total time limit: 1000ms memory limit: 65536kB description

You buy a box of n apples, and it's unfortunate to buy a bug in the box. A bug can eat an apple every x hour, assuming that the bug won't eat before you eat an apple, then you've a number of full apples.

Input input line only, including n, x, and y ( all integer ). Enter data to ensure y <= n * x. Output output is also only one line, the number of the rest of the apple
10 4 9
Sample output
7
Note: it's required to complete the number of apples.


#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
 int n, x, y;
 bool b;
 cin>> n>> x>> y;
 b = y%x;
 cout <<n-y/x-b <<endl;
 return 0;
}





Copyright © 2011 Dowemo All rights reserved.    Creative Commons   AboutUs