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.
3139
1 2<H1><font color="#000000">Problem A:</font> Citation Format</H1>3 4<p>5To write a research paper, you should definitely follow the structured format. This format, in many cases, is strictly defined, and students who try to write their papers have a hard time with it.6</p>7 8<p>9One of such formats is related to citations. If you refer several pages of a material, you should enumerate their page numbers in ascending order. However, enumerating many page numbers waste space, so you should use the following abbreviated notation:10</p>11 12<p>13When you refer all pages between page <i>a</i> and page <i>b</i> (<i>a</i> < <i>b</i>), you must use the notation "<i>a</i>-<i>b</i>". For example, when you refer pages 1, 2, 3, 4, you must write "1-4" not "1 2 3 4". You must not write, for example, "1-2 3-4", "1-3 4", "1-3 2-4" and so on. When you refer one page and do not refer the previous and the next page of that page, you can write just the number of that page, but you must follow the notation when you refer successive pages (more than or equal to 2). Typically, commas are used to separate page numbers, in this problem we use space to separate the page numbers.14</p>15 16<p>17You, a kind senior, decided to write a program which generates the abbreviated notation for your junior who struggle with the citation.18</p>19 20<H2>Input</H2>21 22<p>23Input consists of several datasets.24</p>25 26<p>27The first line of the dataset indicates the number of pages <i>n</i>.28</p>29 30<p>31Next line consists of <i>n</i> integers. These integers are arranged in ascending order and they are differ from each other.32</p>33 34<p>35Input ends when <i>n</i> = 0.36</p>37 38<H2>Output</H2>39 40<p>41For each dataset, output the abbreviated notation in a line. Your program should not print extra space. Especially, be careful about the space at the end of line.42</p>43 44<H2>Constraints</H2>45 46<ul>47<li>1 ≤ <i>n</i> ≤ 50</li>48</ul>49 50<H2>Sample Input</H2>51<pre>525531 2 3 5 6543557 8 956057</pre>58 59<H2>Output for the Sample Input</H2>60<pre>611-3 5-6627-963</pre>64 65 66 