Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int n, m, k, nom;
- cin >> m >> n;
- if (n == m) {
- cout << -1 << "\n";
- }
- else {
- if (m > n) cout << 1 << " " << m - n << "\n";
- else cout << 2 << " " << n - m << "\n";
- }
- fflush(stdout);
- while(true) {
- cin >> nom;
- if (k == -1) break;
- cin >> k;
- if (nom == 1) cout << 2 << " " << k << "\n";
- else cout << 1 << " " << k << "\n";
- fflush(stdout);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement