Datasets:

Modalities:
Image
Text
Formats:
parquet
Size:
< 1K
Tags:
code
Libraries:
Datasets
pandas
License:
hackercup / 2011 /round1a /wine_tasting.html
wjomlex's picture
2011 Problems
df6dd12 verified
raw
history blame
1.55 kB
A group of Facebook employees just had a very successful product launch. To
celebrate, they have decided to go wine tasting. At the vineyard, they decide
to play a game. One person is given some glasses of wine, each containing a
different wine. Every glass of wine is labelled to indicate the kind of wine
the glass contains. After tasting each of the wines, the labelled glasses are
removed and the same person is given glasses containing the same wines, but
unlabelled. The person then needs to determine which of the unlabelled glasses
contains which wine. Sadly, nobody in the group can tell wines apart, so they
just guess randomly. They will always guess a different type of wine for each
glass. If they get enough right, they win the game. You must find the number
of ways that the person can win, modulo 1051962371.<br/><br/>
<h3>Input</h3>
The first line of the input is the number of test cases, <strong>N</strong>. The next <strong>N</strong> lines
each contain a test case, which consists of two integers, <b>G</b> and
<b>C</b>, separated by a single space. <b>G</b> is the total number of glasses
of wine and <b>C</b> is the minimum number that the person must correctly
identify to win.<br/><br/>
<h3>Constraints</h3>
<ul>
<li><strong>N</strong> = 20</li>
<li>1 &le; <strong>G</strong> &le; 100</li>
<li>1 &le; <strong>C</strong> &le; <strong>G</strong></li>
</ul><br/>
<h3>Output</h3>
For each test case, output a line containing a single integer, the
number of ways that the person can win the game modulo 1051962371.