Beginner Beginners Problems > Ad-hoc

As you know, Miraclaw is a very smart cat. He is so young yet he has recently managed to learn how to count and add all by himself! So, Garfield gives him a task. He gives Miraclaw **N** baskets each containing some marbles. The **i'th** basket contains **Ai** marbles. Now, Garfield asks him how many marbles are there in all the baskets? [ **0** based indexing ] It may look like a easy task for you but don't forget Miraclaw is a small *Kitten*, So he makes mistakes. If there are **x** marbles in a basket, he counts as if **x - i** marbles are there in the (**i 'th**) basket. Obviously, Miraclaw is smart enough to know that number of marbles in a basket can never be negative. You are also given the same task. Now, the actual number of marbles in the basket given, you have to tell **the difference between your answer and Miraclaw's answer**. Input: ------ There are **T** test cases. **0 < T < 101** For each of the test case, You are given N integers. **0 < N < 101** Then in one line you are given **N** integers. **( -1 < Ai < 1000001 )** Output: ------- For each test case, print a single integer (The answer). Sample Input ------------ 2 5 1 2 4 3 5 7 9 8 7 6 3 6 7 Sample Output ------------- 10 20

Zabir Al Nazi Nabil

Language |
Time Limit (seconds) |

C | 1.00 |

C++ | 1.00 |

C++14 | 1.00 |

C# | 2.00 |

Go | 2.00 |

Java | 2.00 |

JavaScript | 2.00 |

Objective-C | 2.00 |

Perl | 2.00 |

PHP | 2.00 |

Python | 2.00 |

Python3 | 2.00 |

Ruby | 2.00 |

VB.Net | 2.00 |

Solve/Submission

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

01 | joy25896 | Cpp14 | 0.00s |

02 | emrul | Cpp14 | 0.00s |

03 | ronok_cse | Cpp14 | 0.00s |

04 | ash12 | Cpp14 | 0.00s |

05 | maxhasan | Cpp14 | 0.00s |

06 | gazi93 | Cpp14 | 0.00s |

07 | terminator_c | Cpp14 | 0.00s |

08 | HM39 | Cpp14 | 0.00s |

09 | giash_uddin | Cpp14 | 0.00s |

10 | deder | Cpp14 | 0.00s |

11 | SakibAlamin | Cpp14 | 0.00s |

12 | gsshanto | Cpp14 | 0.00s |

13 | nazmul_bzs | Cpp14 | 0.00s |

14 | Himon_PUST | Cpp14 | 0.00s |

15 | Mhkhaled | Cpp14 | 0.00s |

16 | Nazmul_WUB | Cpp14 | 0.00s |

17 | Koushik54 | Cpp14 | 0.00s |

18 | smriad | Cpp14 | 0.00s |

19 | afzalul | Cpp14 | 0.00s |

20 | rabiulrafi01 | Cpp14 | 0.00s |

21 | rezaul_karim | Cpp14 | 0.00s |

22 | sadia2427 | Cpp14 | 0.00s |

23 | jim1 | Cpp14 | 0.00s |

24 | Mehedi07 | Cpp14 | 0.00s |

25 | soumitro_cse1604114 | Cpp14 | 0.00s |

26 | Foysal_36 | Cpp14 | 0.00s |

27 | mrinmoi | Cpp14 | 0.00s |

28 | Mahadi024 | Cpp14 | 0.00s |

29 | mahbub07 | Cpp14 | 0.00s |

30 | Nasif | Cpp14 | 0.00s |

31 | Sabiha_1604070 | Cpp14 | 0.00s |

32 | esha1604103 | Cpp14 | 0.00s |

33 | 1604118 | Cpp14 | 0.00s |

34 | shifat1604112 | Cpp14 | 0.00s |

35 | 1604099_ishtiaq | Cpp14 | 0.00s |

36 | Sudipta_Nath | Cpp14 | 0.00s |

37 | prodipdatta7 | Cpp14 | 0.00s |

38 | mahathir | C | 0.00s |

39 | subhashis_cse | Cpp | 0.00s |

40 | ismail_cse15 | Cpp14 | 0.00s |

41 | opu1604073 | C | 0.00s |

42 | CSE1604084_Mahir | C | 0.00s |

43 | pulak_ict_mbstu | Cpp14 | 0.00s |

44 | Afif_Fahim | C | 0.00s |

45 | omar1604082 | C | 0.00s |

46 | DynamicOvi | Cpp | 0.00s |

47 | ashish_pondit | C | 0.00s |

48 | Afroza_Akter | Cpp | 0.00s |

49 | Morass | Cpp14 | 0.00s |

50 | rykamol | Cpp | 0.00s |

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. :(