Advertisement
stupid_pro

Торт (ВСОШ 19 года)

Oct 18th, 2021
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.19 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main(){
  4. int a, b, k;
  5. cin >>a >>b >>k;
  6. for (int i=0; i<k; i++){
  7.  if ((a-1)*b>=a*(b-1)) a-=1;
  8.  else b-=1;
  9. }
  10. cout <<a <<" " <<b;
  11.     return 0;
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement