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: Babylonian Roulette
Description
People of Babylon were devoted to chance games and one of the most popular was a special kind of roulette. Recently, some old Babylonian tablets were found. They described details of the roulette game. In modern terms, the rules of the game were as follows:
Beside the tablets that explained the rules some other tablets were found. These had lines with three numbers. Archeologists conjecture that each of these lines were part of a kind of accountability system for the game, where numbers represented, for a given day, the value of the pot at the beginning, the bet and the value of the pot at the end. For example, a line with the number
could mean that there was only one turn where the player won with label On the other hand, there were found other tablets with triplets of numbers that seem like the above described that, however, cannot represent results of a game day. There is no hypothesis of what they are. Archeologists want to validate their hypothesis analyzing batches of tablets with triplets. They want to estimate the number of people that played in a day. To begin, they want to establish, for each triplet of numbers in a tablet that could represent a result of a game day, the minimal number of players that played that day. In the above example the answer to this question is Input The input file contains several test cases, each one of them in a separate line. Each test case is a triplet of non negative integers, indicating the initial pot, the bet and the final pot for a day. Each of the input numbers is less than 108. The initial pot and the bet are greater than 0. A line with a triplet of Output Output texts for each input case are presented in the same order that input is read. For each test case the answer must be a printed line. If the test case cannot represent the result of a game day, the output line has the words Sample Input 10000 1000 22000 24 13 2 5100 700 200 54 16 158 360 6 72 25 10 5 0 0 0 Sample Output 4 No accounting tablet 3 No accounting tablet 16 1 Hint English translation of the Spanish preface:
(cited from here) Source |
[Submit] [Go Back] [Status] [Discuss]
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator