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 | ash12 | Cpp14 | 0.00s |

02 | subhashis_cse | Cpp | 0.00s |

03 | Nazmul_WUB | Cpp14 | 0.00s |

04 | sherina | Cpp | 0.00s |

05 | emrul | Cpp14 | 0.00s |

06 | ronok_cse | Cpp14 | 0.00s |

07 | maxhasan | Cpp14 | 0.00s |

08 | gazi93 | Cpp14 | 0.00s |

09 | prodipdatta7 | Cpp14 | 0.00s |

10 | joy25896 | Cpp14 | 0.00s |

11 | deder | Cpp14 | 0.00s |

12 | rykamol | Cpp | 0.00s |

13 | non_coder | C | 0.00s |

14 | pulak_ict_mbstu | Cpp14 | 0.00s |

15 | rezaul_karim | Cpp14 | 0.00s |

16 | mahbub07 | Cpp14 | 0.00s |

17 | afzalul | Cpp14 | 0.00s |

18 | giash_uddin | Cpp14 | 0.00s |

19 | mrinmoi | Cpp14 | 0.00s |

20 | feodorv | C | 0.00s |

21 | leenaiitju | C | 0.00s |

22 | JubayerSohel | Cpp | 0.00s |

23 | Mehedi07 | Cpp14 | 0.00s |

24 | Mhkhaled | Cpp14 | 0.00s |

25 | terminator_c | Cpp14 | 0.00s |

26 | sadia2427 | Cpp14 | 0.00s |

27 | SakibAlamin | Cpp14 | 0.00s |

28 | nazmul_bzs | Cpp14 | 0.00s |

29 | DynamicOvi | Cpp | 0.00s |

30 | jim1 | Cpp14 | 0.00s |

31 | HM39 | Cpp14 | 0.00s |

32 | gsshanto | Cpp14 | 0.00s |

33 | Himon_PUST | Cpp14 | 0.00s |

34 | Koushik54 | Cpp14 | 0.00s |

35 | smriad | Cpp14 | 0.00s |

36 | markII | C | 0.00s |

37 | Mahadi024 | Cpp14 | 0.00s |

38 | rabiulrafi01 | Cpp14 | 0.00s |

39 | Foysal_36 | Cpp14 | 0.00s |

40 | milon019 | Cpp | 0.00s |

41 | Sabiha_1604070 | Cpp14 | 0.00s |

42 | opu1604073 | C | 0.00s |

43 | soumitro_cse1604114 | Cpp14 | 0.00s |

44 | Sudipta_Nath | Cpp14 | 0.00s |

45 | shifat1604112 | Cpp14 | 0.00s |

46 | mahathir | C | 0.00s |

47 | ashish_pondit | C | 0.00s |

48 | omar1604082 | C | 0.00s |

49 | 1604099_ishtiaq | Cpp14 | 0.00s |

50 | CSE1604084_Mahir | C | 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. :(