Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int x, y;
- while (cin >> x && cin >> y && x != -1) {
- int a = min(x, y), b = max(x, y);
- int loss = a; // a, a
- while (2*loss+1 <= b) loss = 2*loss+1;
- // move from a, b to a, loss
- cout << (a == x ? 'H' : 'V') << ' ' << loss << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement