CF869B.The Eternal Immortality

普及/提高-

通过率:0%

AC君温馨提醒

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

题目描述

Even if the world is full of counterfeits, I still regard it as wonderful.

Pile up herbs and incense, and arise again from the flames and ashes of its predecessor — as is known to many, the phoenix does it like this.

The phoenix has a rather long lifespan, and reincarnates itself once every a!a! years. Here a!a! denotes the factorial of integer aa , that is, a!=1×2×...×aa!=1×2×...×a . Specifically, 0!=10!=1 .

Koyomi doesn't care much about this, but before he gets into another mess with oddities, he is interested in the number of times the phoenix will reincarnate in a timespan of b!b! years, that is, . Note that when b>=ab>=a this value is always integer.

As the answer can be quite large, it would be enough for Koyomi just to know the last digit of the answer in decimal representation. And you're here to provide Koyomi with this knowledge.

输入格式

The first and only line of input contains two space-separated integers aa and bb ( 0<=a<=b<=10180<=a<=b<=10^{18} ).

输出格式

Output one line containing a single decimal digit — the last digit of the value that interests Koyomi.

输入输出样例

  • 输入#1

    2 4
    

    输出#1

    2
    
  • 输入#2

    0 10
    

    输出#2

    0
    
  • 输入#3

    107 109
    

    输出#3

    2
    

说明/提示

In the first example, the last digit of is 22 ;

In the second example, the last digit of is 00 ;

In the third example, the last digit of is 22 .

首页