1961 新函数


Submit solution

Points: 100
Time limit: 1.0s
Memory limit: 32M

Problem types
Allowed languages
C, C++, Java, Python

Description

数学课上,小明的老师给出一个新函数f(n)让小明算。对于任意正整数n,f(n)表示1+2+3+…+n的末位数字,随着n的增大,小明开始冒汗,请你帮小明摆平吧。

Input

一些整数n(1≤n<1E+9),若n=0,表示运行结束。

Output

对于每个n,输出f(n),占一行。

Sample

Input

1 2 3 5 6 0

Output

1
3
6
5
1

Hint

f(20)=0


Source: qn


Comments

There are no comments at the moment.