#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--){
int n,k;
cin>>n>>k;
if(n==k){
cout<<"0"<<endl;
}else
if(n%5==0&&k%5==0){
cout<<n/5-k/5<<endl;
}else if(n%5!=0&&k%5==0){
cout<<n/5-k/5+1<<endl;
}else if(n%5==0&&k%5!=0){
cout<<n/5-k/5-1<<endl;
}
else{
cout<<n/5-k/5<<endl;
}
}
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: