There is this renowned University named Fibonacci University. It is perfect in all aspects. However it has a rule which is completely different from any other school or University - its marking system. The rule says:

**1)** Allot marks to each and every student based on his/her perfomance.

**2)** Multiply the marks of those students whose roll numbers are belong to fibonacci number.

**3)** In case the marks of any student crosses 100, divide it by 100 and take the remainder.

Professor Basu teaches Logic Design in this University. Exams are over and all the teachers are required to submit the class average of students in their particular course. However Professor Basu is sick and wants you to do the task on his behalf.

**Input:**

The first line of input takes the number of test case, **T**. Then **T** test cases follow .Each test case consist of 2 lines .The first line of each test takes has an integer **N** where **N** is the number of students.The second line takes** N** space separated integers, where ** i th **integer denoting the marks obtained by the student with roll number **i**.

**Output:**

For each test case print the class average (floor value) for each test case in a new line.

**Constraints:**

1 <= T <= 100

1 <= N <= 100

1 <= Marks <= 100

**Example:**

**Input:**

3

5

34 78 80 91 99

7

30 20 67 90 23 34 53

10

78 87 89 90 67 78 65 56 99 35

**Output:**

63

37

66

**Explanation:**

In the first test case, there are 5 students.

Roll No 1 gets 34. 1 is a fibonacci number and hence 34 is multiplied by 1.

Roll No 2 gets 78. 2 is a fibonacci number and hence 78 is multiplied by 2 and becomes 156 which being greater than 100 is reduced to 56.

Roll No 3 gets 80. 3 is a fibonacci number and hence 80 is multiplied by 3 and it becomes 240 which being greater than 100 is reduced to 40.

Roll No 4 gets 91. 4 is not a fibonacci number and hence 91 is kept as it is.

Roll No 5 gets 99. 5 is a fibonacci number and hence 99 is multiplied by 5 and becomes 495 which being greater than 100 is reduced to 95. The class total becomes 316 and an average of 63.2 floor of which is 63 .

The other test cases follow from the same logic.

Author: akundusaltlake

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

Sulagna | 117 |

RUTVIKHARIPARA | 116 |

janvidavda105190 | 93 |

harshsiddhapura105461 | 93 |

devsinghindra | 80 |

PiyushPandey4 | 614 |

ASWATHAMA | 561 |

akhyasharma01 | 547 |

john_wick | 521 |

jagrit_07 | 443 |

blackshadows | 5362 |

Ibrahim Nash | 5242 |

akhayrutdinov | 5111 |

mb1973 | 4929 |

Quandray | 4598 |

Login to report an issue on this page.