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