codeforces-scrape

Codeforces scraped problems and editorials
git clone git://git.laack.co/codeforces-scrape.git
Log | Files | Refs | README

25B.md (990B)


      1 Source: https://codeforces.com/problemset/problem/25/B
      2 
      3 B. Phone numbers
      4 
      5 time limit per test
      6 
      7 2 seconds
      8 
      9 memory limit per test
     10 
     11 256 megabytes
     12 
     13 input
     14 
     15 stdin
     16 
     17 output
     18 
     19 stdout
     20 
     21 Phone number in Berland is a sequence of *n* digits. Often, to make it easier to memorize the number, it is divided into groups of two or three digits. For example, the phone number 1198733 is easier to remember as 11-987-33. Your task is to find for a given phone number any of its divisions into groups of two or three digits.
     22 
     23 Input
     24 
     25 The first line contains integer *n* (2 ≤ *n* ≤ 100) — amount of digits in the phone number. The second line contains *n* digits — the phone number to divide into groups.
     26 
     27 Output
     28 
     29 Output any of divisions of the given phone number into groups of two or three digits. Separate groups by single character -. If the answer is not unique, output any.
     30 
     31 Examples
     32 
     33 Input
     34 
     35 ```
     36 6  
     37 549871
     38 ```
     39 
     40 Output
     41 
     42 ```
     43 54-98-71
     44 ```
     45 
     46 Input
     47 
     48 ```
     49 7  
     50 1198733
     51 ```
     52 
     53 Output
     54 
     55 ```
     56 11-987-33
     57 ```