原题:

Description

Although Dreamone has been studying in USTC for nearly one year,he is missing the mates of swust all the time.Recently Dreamone has found the equation through which he can feel be with them immediately,then what is the mysterious equation?

Given a number x(-100<=x<=100) and a funciton f(x).

when x<0,f(x)=0

when 0<=x<1,f(x)=1

when 1<=x<=100,f(x)=f(x-20.07)+f(x-4.28)+f(x-20.10)+f(x-6.11)

Because 2007.4.28 is a special day for Dreamone,so is 2010.6.11!

Maybe f(x) will be very large,so only output the most right four numbers(omitting leading zero).For example,if f(x)=521314,just output 1314;if f(x)=20080906,just output 906;

if f(x)=306,just output 306.

Can you solve the simple problem? 

Input

The first line,a integer T,representing T test cases blew.(T<=1000).

Then each line contains a number x(-100<=x<=100).

Output

For each number x,output the most right four numbers of f(x)(omitting leading zero).

Sample Input

2-12

Sample Output

00
 
分析:
简单数学题~~~~~~
源码:  
#include <stdio.h> double f(double x) {     if(x<0)         return 0;     else if(x>=0 && x<1)         return 1;     else         return f(x-20.07)+f(x-4.28)+f(x-20.10)+f(x-6.11); } int main() {     int k;     double n;     scanf("%d",&k);     while(k--)     {         scanf("%lf",&n);         if(n<0)         {             printf("0\n");         }         else if(n<1 && n>=0)         {             printf("1\n");         }         else         {             printf("%d\n",(int)f(n)%10000);         }     }     return 0; }