Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // codechef MAGICJAR: https://www.codechef.com/problems/MAGICJAR
- #include <iostream>
- using namespace std;
- #define ll long long
- int main() {
- // your code goes here
- ll t ;
- cin>>t;
- while(t--){
- ll n;
- cin>>n;
- ll a[n+1];
- ll sum=0;
- for (ll i=1; i<=n; i++){
- cin>>a[i];
- sum+=a[i]-1;
- }
- cout<<sum+1<<"\n";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement