CF456B.Fedya and Maths

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Fedya studies in a gymnasium. Fedya's maths hometask is to calculate the following expression:

(1n+2n+3n+4n) mod 5(1^{n}+2^{n}+3^{n}+4^{n}) mod 5 for given value of nn . Fedya managed to complete the task. Can you? Note that given number nn can be extremely large (e.g. it can exceed any integer type of your programming language).

输入格式

The single line contains a single integer nn ( 0n101050\le n\le10^{10^5} ). The number doesn't contain any leading zeroes.

输出格式

Print the value of the expression without leading zeros.

输入输出样例

  • 输入#1

    4
    

    输出#1

    4
    
  • 输入#2

    124356983594583453458888889
    

    输出#2

    0
    

说明/提示

Operation x mod yx mod y means taking remainder after division xx by yy .

Note to the first sample:

首页