CF742A.Arpa’s hard exam and Mehrdad’s naive cheat

普及/提高-

通过率:0%

AC君温馨提醒

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

题目描述

There exists an island called Arpa’s land, some beautiful girls live there, as ugly ones do.

Mehrdad wants to become minister of Arpa’s land. Arpa has prepared an exam. Exam has only one question, given nn , print the last digit of 1378n1378^{n} .

Mehrdad has become quite confused and wants you to help him. Please help, although it's a naive cheat.

输入格式

The single line of input contains one integer nn ( 0<=n<=1090<=n<=10^{9} ).

输出格式

Print single integer — the last digit of 1378n1378^{n} .

输入输出样例

  • 输入#1

    1
    

    输出#1

    8
  • 输入#2

    2
    

    输出#2

    4

说明/提示

In the first example, last digit of 13781=13781378^{1}=1378 is 88 .

In the second example, last digit of 13782=13781378=18988841378^{2}=1378·1378=1898884 is 44 .

首页