Team Ai
Datasetpublic

prithivMLmods/Coder-Stat

Coder-Stat Dataset Overview The Coder-Stat dataset is a collection of programming-related data, including problem IDs, programming languages, original statuses, and source code snippets. This dataset is designed to assist in the analysis of coding patterns, error types, and performance metrics. Dataset Details Modalities Tabular: The dataset is structured in a tabular format. Text: Contains text data, including source code snippets.… See the full description on the dataset page: https://huggingface.co/datasets/prithivMLmods/Coder-Stat.

sourceHugging Faceapache-2.0updated 2y agoView on Hugging Face
3likes139downloads
p00865.html76 linesDownload Raw Back to problem_descriptions
1 2<H1><font color="#000">Problem B:</font> Expected Allowance</H1>3 4<p>5Hideyuki is allowed by his father Ujisato some 1000 yen bills every month for his pocket money.6In the first day of every month, the number of bills is decided as follows. Ujisato prepares <i>n</i>7pieces of <i>m</i>-sided dice and declares the cutback <i>k</i>. Hideyuki rolls these dice. The number of8bills given is the sum of the spots of the rolled dice decreased by the cutback. Fortunately to9Hideyuki, Ujisato promises him to give at least one bill, even if the sum of the spots does not10exceed the cutback. Each of the dice has spots of 1 through m inclusive on each side, and the11probability of each side is the same.12</p>13<p>14In this problem, you are asked to write a program that finds the expected value of the number15of given bills.16</p>17 18<p>19For example, when <i>n</i> = 2, <i>m</i> = 6 and <i>k</i> = 3, the probabilities of the number of bills being 1, 2, 3, 4, 5, 6, 7, 8 and 9 are 1/36 + 2/36 + 3/36, 4/36, 5/36, 6/36, 5/36, 4/36, 3/36, 2/36 and 1/36, respectively.20</p>21<p>22Therefore, the expected value is23</p>24 25<p>26(1/36 + 2/36 + 3/36) &times; 1 + 4/36 &times; 2 + 5/36 &times; 3 + 6/36 &times; 4 + 5/36 &times; 5 + 4/36 &times 6 + 3/36 &times 7 + 2/36 &times 8 + 1/36 &times 9, which is approximately 4.11111111.27</p>28 29<H2>Input</H2>30 31<p>32The input is a sequence of lines each of which contains three integers n, m and k in this order.33They satisfy the following conditions.34</p>35 36<p>371 &le; <i>n</i><br>382 &le; <i>m</i><br>390 &le; <i>k</i> &lt; <i>nm</i><br>40<i>nm</i> &times; <i>m<sup>n</sup></i> &lt 100000000 (10<sup>8</sup>)<br>41</p>42 43<p>44The end of the input is indicated by a line containing three zeros.45</p>46 47<H2>Output</H2>48 49<p>50The output should be comprised of lines each of which contains a single decimal fraction. It is51the expected number of bills and may have an error less than 10<sup>-7</sup> . No other characters should52occur in the output.53 54</p>55 56<H2>Sample Input</H2>57<pre>582 6 0592 6 3603 10 96113 3 27621 2008 3630 0 064</pre>65 66<H2>Output for the Sample Input</H2>67<pre>687.00000000694.11111111707.71000000711.42902599721001.5029880573</pre>74 75 76