codeforces-scrape

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

456B.md (1011B)


      1 Source: https://codeforces.com/problemset/problem/456/B
      2 
      3 B. Fedya and Maths
      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 stdin
     16 
     17 output
     18 
     19 stdout
     20 
     21 Fedya studies in a gymnasium. Fedya's maths hometask is to calculate the following expression:
     22 
     23 (1*n* + 2*n* + 3*n* + 4*n*) *mod* 5
     24 
     25 for given value of *n*. Fedya managed to complete the task. Can you? Note that given number *n* can be extremely large (e.g. it can exceed any integer type of your programming language).
     26 
     27 Input
     28 
     29 The single line contains a single integer *n* (0 ≤ *n* ≤ 10105). The number doesn't contain any leading zeroes.
     30 
     31 Output
     32 
     33 Print the value of the expression without leading zeros.
     34 
     35 Examples
     36 
     37 Input
     38 
     39 ```
     40 4
     41 ```
     42 
     43 Output
     44 
     45 ```
     46 4
     47 ```
     48 
     49 Input
     50 
     51 ```
     52 124356983594583453458888889
     53 ```
     54 
     55 Output
     56 
     57 ```
     58 0
     59 ```
     60 
     61 Note
     62 
     63 Operation *x* *mod* *y* means taking remainder after division *x* by *y*.
     64 
     65 Note to the first sample:
     66 
     67 ![](https://espresso.codeforces.com/825f244180bb10323db01645118c3cfdb312fa89.png)