Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- X = int(input())
- Y = int(input())
- if X == 1:
- print(1)
- else:
- if Y == X:
- print(-1)
- else:
- if Y - X == 1:
- print(X * (X - 1))
- else:
- if (Y - X) > 1 and Y < 2 * X - 1:
- print(2 * X)
- else:
- if Y >= 2 * X - 1:
- print(X)
- else:
- print(-1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement