[Login|Register]
Problems

Status

Rank

Problem 1162
Formula of Love
Time Limit: 1000ms
Memory Limit: 65536kb
Description
“两个原来陌生的名字
寂寞的公因数
是什么样子
我们受过的伤
在困难的考试
时间用它的方法
计算出爱的公式”

WAG经过两年的思考,终于研究出了爱的方程式:
f(x) = f(x-5.21)+f(x-13.14), x>=1
现在已知:
f(x)=0, x<0
f(x)=1, 0<=x<1
对于给定的x,求解f(x).也许f(x)的值可能会很大,输出对1000000007取模后的余数。
Input
第一行一个数N,表明有N个Cases(N<=100)。 之后有N行,每行一个数X(-1000<=X<=1000)(小数点后面最多只有三位),求f(X)。
Output
对应每一个X,输出f(X)。
Sample Input
2
13.24
2
Sample Output
1
0
University of Science and Technology of China
Online Judge for ACM/ICPC
Processed in 1.7ms with 1 query(s).