测评会员优惠活动进行中 · 开通 VIP,有效期内测评不限次 VIP 优惠中 · 测评不限次 立即查看

A11194. The Eternal Immortality

编程题 普及/提高-

题目描述

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!$ years. Here $a!$ denotes the factorial of integer $a$ , that is, $a!=1×2×...×a$ . Specifically, $0!=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!$ years, that is, ![](/uploads/acgo/image/9f5a1433050f9194_6b00cecf4bb4.jpeg). Note that when $b>=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 $a$ and $b$ ( $0<=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 ![](/uploads/acgo/image/50af1a53ce6dc0a6_1244fd0dfbcc.jpeg) is $2$ ;

In the second example, the last digit of ![](/uploads/acgo/image/b5afe0ba627df686_62449c9cfdd5.jpeg) is $0$ ;

In the third example, the last digit of ![](/uploads/acgo/image/f826b867c2c17967_a236d7127469.jpeg) is $2$ .
上一题 去做题 下一题