codeforces-scrape

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

1910A.md (1578B)


      1 Source: https://codeforces.com/problemset/problem/1910/A
      2 
      3 A. Username
      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 standard input
     16 
     17 output
     18 
     19 standard output
     20 
     21 On the official website of Berland, each account has two parameters: username and ID.
     22 
     23 Username is a string consisting of lowercase Latin letters and/or digits, which contains at least one letter. For example, user0, 1fox1, zzzz are correct usernames, but 1337 and User22 are not.
     24 
     25 The ID of the account for a given username is generated as follows: a positive integer without leading zeroes is appended to the end of the username. For example, the ID user0125 can be generated by the following usernames: user012, user01, user0; but neither by user nor us.
     26 
     27 You are given a string $s$ — a valid ID. Your task is to determine any valid username that can generate the given ID. If there are several correct usernames, you can print any of them.
     28 
     29 Input
     30 
     31 The first line contains a single integer $t$ ($1 \le t \le 10^3$) — the number of test cases.
     32 
     33 The only line of each test case contains a string $s$ ($2 \le |s| \le 50$), consisting of lowercase Latin letters and/or digits.
     34 
     35 Additional constraint on input: there is at least one valid username that can generate the given ID.
     36 
     37 Output
     38 
     39 For each test case on a separate line, print a string — any valid username that can generate the given ID. If there are multiple correct usernames, you can print any of them.
     40 
     41 Example
     42 
     43 Input
     44 
     45 ```
     46 4
     47 
     48 user0125
     49 
     50 a1
     51 
     52 kotlin990000
     53 
     54 1code0forces101
     55 ```
     56 
     57 Output
     58 
     59 ```
     60 user0
     61 a
     62 kotlin9
     63 1code0forces
     64 ```