Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|

Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |

Language: And Then There Was One
Description Let’s play a stone removing game. Initially,
Input The input consists of multiple datasets each of which is formatted as follows.
The last dataset is followed by a line containing three zeros. Numbers in a line are separated by a single space. A dataset satisfies the following conditions. 2 ≤ The number of datasets is less than 100. Output For each dataset, output a line containing the stone number left in the final state. No extra characters such as spaces should appear in the output. Sample Input 8 5 3 100 9999 98 10000 10000 10000 0 0 0 Sample Output 1 93 2019 Source |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator