-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patha.txt
More file actions
49 lines (31 loc) · 731 Bytes
/
a.txt
File metadata and controls
49 lines (31 loc) · 731 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include<bits/stdc++.h>
typedef long long ll;
typedef long double ld;
#define FASTIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
using namespace std;
const ll inf = 1e17;
const ll N = 1e6+10;
const ll bits = 30;
const ll mod = 1e9+7;
int main(){
// FASTIO;
ll q,h,n;
cin>>q;
while(q--){
cin>>h>>n;
cout<<h<<" "<<n<<"\n";
vector<ll>arr(n);
for(int i=0;i<n;i++){
cin>>arr[i];
}
cout<<"here";
arr.push_back(0);
ll ans = 0;
for(int i=0;i<n;i++){
if(arr[i]-arr[i+1]>2){
ans+=arr[i]-arr[i+1]-2;
}
}
cout<<ans<<"\n";
}
}