Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions Problem: JDELAY
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/* package codechef;Problem: JDELAY Contest: LTIME64B */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
for (int i=0;i<t;i++)
{
int count=0;
int n=sc.nextInt();
int s[]=new int[n];
int j[]=new int[n];
for (int k=0;k<n;k++)
{
s[k]=sc.nextInt();
j[k]=sc.nextInt();
int diff=j[k]-s[k];
if(diff>5)
count++;
}
System.out.println(count);
}
}
}