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: 105ms
Memory: 1120kB
Author: 2018212212185
In contest: 1284

#include<stdio.h>
#include<math.h>
#include<stdlib.h>
int fib(int n);
int main(){
	int n,i,a;
	while(scanf("%d",&n)!=EOF){
		a=0;
		for(i=0;i<30;i++){
			if(fib(i)==n){
			    a=1;
			    break;
			}
		}
		if(a==1)
		printf("Lucky Day\n");
		else if(a==0)
		printf("Bad Day\n");
	}
	return 0;
}
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;
}