Fabliha and Oishy are playing a game called " Finding Fibonacci Digit " . As they are very fond of Fibonacci numbers, they are trying to find how fast one can guess the last digit of n-th Fibonacci number. Can you do the same as fast as them ? Fibonacci numbers are : 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ....... starting from 0-th Fibonacci numbers. We see that Fibonacci of n-th = Fibonacci of (n-1)th + Fibonacci of (n-2)th , here n starts from ZERO. Input: ------ Input starts with an integer T (1<=20), denoting the number of test cases. Each case contains an integer N (0 ≤ N ≤ 10^9) denoting the N-th Fibonacci number. Your task is to find the last digit of N-th Fibonacci number. For N = 5, the output should be 5. Output: ------- Print the last digit of N-th Fibonacci number in a line. See output format for details. Sample Input ------------ 2 5 7 Sample Output ------------- Case 1: 5 is the last digit. Case 2: 3 is the last digit.

Sifat Siddiqi Shishir

Language |
Time Limit (seconds) |

C | 1.00 |

C++ | 1.00 |

C++14 | 1.00 |

C# | 3.00 |

Go | 3.00 |

Java | 3.00 |

JavaScript | 3.00 |

Objective-C | 3.00 |

Perl | 3.00 |

PHP | 3.00 |

Python | 3.00 |

Python3 | 3.00 |

Ruby | 3.00 |

VB.Net | 3.00 |

Solve/Submission

# | User | Language | Timing |
---|---|---|---|

01 | sakib_muhit | Cpp14 | 0.00s |

02 | AlaminJust | Cpp14 | 0.00s |

03 | ash12 | Cpp14 | 0.00s |

04 | seyedssz | Cpp14 | 0.00s |

05 | MAHRahat | Cpp14 | 0.00s |

06 | terminator_c | Cpp14 | 0.00s |

07 | sadia2427 | Cpp14 | 0.00s |

08 | Nazmul_WUB | Cpp14 | 0.00s |

09 | hmtanbir | Cpp14 | 0.00s |

10 | jualahmed | Cpp14 | 0.00s |

11 | Rakib05 | C | 0.00s |

12 | kpretomazi | Cpp | 0.00s |

13 | mahmud2690 | Cpp | 0.00s |

14 | hamedomarkhaled | Cpp | 0.00s |

15 | abdulmukit | Cpp | 0.00s |

16 | wayne6172 | C | 0.00s |

17 | Robbinb1993 | Cpp | 0.00s |

18 | marineCoder | Cpp | 0.00s |

19 | prodipdatta7 | Cpp14 | 0.00s |

20 | Morass | Cpp14 | 0.00s |

21 | Frdhsn | Cpp14 | 0.00s |

22 | Ruhul1975 | Cpp | 0.00s |

23 | rashedul007 | C | 0.00s |

24 | rockersabbir | Cpp | 0.00s |

25 | saeefad | Cpp | 0.00s |

26 | rabbicse | Cpp | 0.01s |

27 | Lion_roar | Cpp | 0.01s |

28 | RandyWaterhouse | Cpp | 0.01s |

29 | joymollick | Cpp14 | 0.01s |

30 | shishir09 | Cpp14 | 0.01s |

31 | JubayerSohel | Cpp14 | 0.01s |

32 | deder | Cpp14 | 0.01s |

33 | onucsecu | Cpp14 | 0.01s |

34 | Dinar | Cpp14 | 0.01s |

35 | smriad | Cpp14 | 0.01s |

36 | ammasum | Cpp14 | 0.01s |

37 | feodorv | C | 0.01s |

38 | rabel | Cpp14 | 0.01s |

39 | _dipu | Cpp14 | 0.01s |

40 | nazmul_bzs | Cpp14 | 0.01s |

41 | FariD | Cpp | 0.01s |

42 | SakibAlamin | Cpp14 | 0.01s |

43 | jim1 | Cpp14 | 0.01s |

44 | joy25896 | Cpp14 | 0.01s |

45 | Ishrak | Cpp14 | 0.07s |

46 | haasib | Cpp14 | 0.07s |

47 | anis | Cpp14 | 0.07s |

48 | robin_aust | Cpp14 | 0.07s |

49 | shabbirdu2012 | Cpp14 | 0.07s |

50 | rayhan50001 | Cpp14 | 0.07s |

Copyright © 2015-2016 Dev Skill.

Feedback
#### Your feedback is our precious!

## Thank you for providing feedback! Our developers will be happy :)

## Sorry there was a problem when submitting the feedback. Please try again. :(