codeforces-scrape

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

1505B.md (643B)


      1 Source: https://codeforces.com/problemset/problem/1505/B
      2 
      3 B. DMCA
      4 
      5 time limit per test
      6 
      7 1 second
      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 Many people are aware of DMCA – Digital Millennium Copyright Act. But another recently proposed DMCA – Digital Millennium Calculation Act – is much less known.
     22 
     23 In this problem you need to find a root of a number according to this new DMCA law.
     24 
     25 Input
     26 
     27 The input contains a single integer $a$ ($1 \le a \le 1000000$).
     28 
     29 Output
     30 
     31 Output the result – an integer number.
     32 
     33 Examples
     34 
     35 Input
     36 
     37 ```
     38 1
     39 ```
     40 
     41 Output
     42 
     43 ```
     44 1
     45 ```
     46 
     47 Input
     48 
     49 ```
     50 81
     51 ```
     52 
     53 Output
     54 
     55 ```
     56 9
     57 ```