SHARE
TWEET

Untitled

a guest Oct 18th, 2019 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     int n, m, k, nom;
  7.     cin >> m >> n;
  8.     if (n == m) {
  9.         cout << -1 << "\n";
  10.     }
  11.     else {
  12.         if (m > n) cout << 1 << " " << m - n << "\n";
  13.         else cout << 2 << " " << n - m << "\n";
  14.     }
  15.     fflush(stdout);
  16.     while(true) {
  17.         cin >> nom;
  18.         if (k == -1) break;
  19.         cin >> k;
  20.         if (nom == 1) cout << 2 << " " << k << "\n";
  21.         else cout << 1 << " " << k << "\n";
  22.         fflush(stdout);
  23.     }
  24.     return 0;
  25. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top