思路:
贪心即可
代码:
#define IOS ios::sync_with_stdio(false)
#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef long long LL;
#define fi first
#define sc second
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define rp(i,n) for(int i=0;i<n;i++)
#define rpn(i,n) for(int i=1;i<=n;i++)
int main(){
IOS;
int t;
cin>>t;
while(t--){
int a,b;
cin>>a>>b;
int dis=abs(a-b);
int ans=dis/5;
dis%=5;
ans+=(dis>>1);
dis%=2;
cout<<ans+dis<<'
';
}
return 0;
}