P7032 [NWRRC 2016] Boys and Girls

Description

Bob found a nice task in his old math book for children. It says: There are $10$ children standing in a circle, $5$ of them stand next to a boy, and $7$ of them stand next to a girl. How is it possible? Here is the solution to the task. If $4$ boys and $6$ girls stand like this: BGBGBGBGGG, there are $5$ children who stand next to a boy (here they are underlined: BGBGBGBGGG), and $7$ children who stand next to a girl $(BGBGBGBGGG).$ Now Bob wants to solve a generalized version of this task: There are $n$ children standing in a circle, $x$ of them stand next to a boy, and $y$ of them stand next to a girl. How is it possible? Help Bob by writing a program that solves the generalized task.

Input Format

N/A

Output Format

N/A

Explanation/Hint

Time limit: 2 s, Memory limit: 256 MB.