Imagine you have a jug with capacity . You also have two glasses (glass 1 and glass 2) that have capacities and , respectively. Initially, the jug is full of water, and the two glasses are empty. To transfer water, you can pour water from one container to another. However, you must continue to pour until either the pouring container is empty, or the receiving container is full. Note that all water you have is in the jug; you cannot get or throw away any water.
This file contains 100 different situations, where each situation is one line that has three space-seperated values: , , and . For example, the line "20 1 4" would assign the value to , the value to , and the value to .
For each situation, you transfer water among the buckets for a while, and you try to generate all possible arrangements of water placement where the jug is empty. Let the set represent all the possible amounts of water in glass 1 when the jug is empty, and let the set represent all the possible amounts of water in glass 2 when the jug is empty. The situation's diversity value is the number of elements in plus the number of elements in .
For example, for the situation , the possible arrangements of water placement where the jug is empty (each in the form ) are . Set would then be , and set would be . The situation's diversity value is therefore .
Find the sum of all the situations' diversity values in the file.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
No explanations have been posted yet. Check back later!