Start: Jul, 10, 2019 08:30:00
2019年度暑期短学期达标测试补考
End: Jul, 10, 2019 11:30:00
Time elapsed:
Time remaining:

Problem_ID: E
Result: Accepted
Time: 102ms
Memory: 1120kB
Author: 2018212212231
In contest: 1284

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
int fib(int n){
   int f0=0,f1=1,f2,i;
   if(n==0||n==1)
	   return n;
   for(f2=f0+f1,i=2;i<n;++i){
      f0=f1;
	  f1=f2;
	  f2=f0+f1;
   }
   return f2;
}
int main(){
    int n;
	while(scanf("%d",&n)!=EOF){
	    int i,flag=0;
		for(i=0;i<10000;i++){
			if(n==fib(i)){
			   printf("Lucky Day\n");
			   flag=1;
			   break;
			}
			if(fib(i)>n)
				break;
		}
		if(flag==0)
			printf("Bad Day\n");
	}
}