Bob watches TV every day. He always sets the volume of his TV to $b$. However, today he is angry to find out someone has changed the volume to $a$. Of course, Bob has a remote control that can change the volume.

There are six buttons ($-5, -2, -1, +1, +2, +5$) on the control, which in one press can either increase or decrease the current volume by $1$, $2$, or $5$. The volume can be arbitrarily large, but can never be negative. In other words, Bob cannot press the button if it causes the volume to be lower than $0$.

As Bob is so angry, he wants to change the volume to $b$ using as few button presses as possible. However, he forgets how to do such simple calculations, so he asks you for help. Write a program that given $a$ and $b$, finds the minimum number of presses to change the TV volume from $a$ to $b$.


-----Input-----

Each test contains multiple test cases. The first line contains the number of test cases $T$ ($1 \le T \le 1\,000$). Then the descriptions of the test cases follow.

Each test case consists of one line containing two integers $a$ and $b$ ($0 \le a, b \le 10^{9}$) — the current volume and Bob's desired volume, respectively.


-----Output-----

For each test case, output a single integer — the minimum number of presses to change the TV volume from $a$ to $b$. If Bob does not need to change the volume (i.e. $a=b$), then print $0$.


-----Example-----
Input
3
4 0
5 14
3 9

Output
2
3
2



-----Note-----

In the first example, Bob can press the $-2$ button twice to reach $0$. Note that Bob can not press $-5$ when the volume is $4$ since it will make the volume negative. 

In the second example, one of the optimal ways for Bob is to press the $+5$ twice, then press $-1$ once.

In the last example, Bob can press the $+5$ once, then press $+1$.

Starter code:

Solutions:
import math
from decimal import Decimal
import heapq
from collections import deque
def na():
	n = int(input())
	b = [int(x) for x in input().split()]
	return n,b
 
 
def nab():
	n = int(input())
	b = [int(x) for x in input().split()]
	c = [int(x) for x in input().split()]
	return n,b,c
 
 
def dv():
	n, m = list(map(int, input().split()))
	return n,m
 
 
def dva():
	n, m = list(map(int, input().split()))
	a = [int(x) for x in input().split()]
	b = [int(x) for x in input().split()]
	return n,m,b
 
 
def eratosthenes(n): 
	sieve = list(range(n + 1))
	for i in sieve:
		if i > 1:
			for j in range(i + i, len(sieve), i):
				sieve[j] = 0
	return sorted(set(sieve))
 
 
def lol(lst,k):
	k=k%len(lst)
	ret=[0]*len(lst)
	for i in range(len(lst)):
		if i+k<len(lst) and i+k>=0:
			ret[i]=lst[i+k]
		if i+k>=len(lst):
			ret[i]=lst[i+k-len(lst)]
		if i+k<0:
			ret[i]=lst[i+k+len(lst)]
	return(ret)
def nm():
	n = int(input())
	b = [int(x) for x in input().split()]
	m = int(input())
	c = [int(x) for x in input().split()]
	return n,b,m,c
 
 
def dvs():
	n = int(input())
	m = int(input())
	return n, m 
 
def fact(a, b):
	c = []
	ans = 0
	f = int(math.sqrt(a))
	for i in range(1, f + 1):
		if a % i == 0:
			c.append(i)
	l = len(c)
	for i in range(l):
		c.append(a // c[i])
	for i in range(len(c)):
		if c[i] <= b:
			ans += 1
	if a / f == f and b >= f:
		return ans - 1
	return ans
 

t = int(input())
for i in range(t):
	a ,b = list(map(int, input().split()))
	if a == b:
		print(0)
	else:
		d = abs(a - b)
		k1 = d//5
		d -= k1 *5 
		k2 = d // 2
		d -= k2 * 2
		print(d + k1 + k2)


import sys
import math

# sys.stdin = open("in.txt")
for _ in range(int(input())):
    a, b = map(int, input().split())
    x = abs(a - b)
    res = x // 5
    x %= 5
    res += x // 2
    x %= 2
    print(res + x)

def main():
    t = int(input())
    for i in range(t):
        a,b = list(map(int,input().split()))
        moves = 0
        diff = abs(a-b)
        x = diff//5
        moves += x
        diff -= (5*x)
        x = diff//2
        moves += x
        diff -= (2*x)
        x = diff
        moves += x

        print(moves)

main()


t = int(input())
for _ in range (t):
    a, b = list(map(int, input().split()))

    d = abs(b - a)
    ans = 0
    ans += d // 5
    d = d % 5
    ans += d // 2
    d %= 2
    ans += d // 1
    d %= 1

    print(ans)


''' بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ '''
#codeforces
gi = lambda : list(map(int,input().split()))
for j in range(gi()[0]):
	a, b = gi()
	d = abs(a - b)
	print(d // 5 + (d % 5) // 2 + ((d % 5) % 2))


t = int(input())

for gg in range(t):
	
	a, b = list(map(int, input().split()))
	d = abs(a-b)
	if d == 0:
		print(0)
	else:
		ans = 0
		ans += d//5
		d%=5
		ans+=d//2
		d%=2
		ans+=d
		print(ans)


from bisect import *
from collections import *
from itertools import *
import functools
import sys
import math
from decimal import *
from copy import *
from heapq import *
from fractions import *
getcontext().prec = 30
MAX = sys.maxsize
MAXN = 1000010
MOD = 10**9+7
spf = [i for i in range(MAXN)]
def sieve():
    for i in range(2,MAXN,2):
        spf[i] = 2
    for i in range(3,int(MAXN**0.5)+1):
        if spf[i]==i:
            for j in range(i*i,MAXN,i):
                if spf[j]==j:
                    spf[j]=i
def fib(n,m):
    if n == 0:
        return [0, 1]
    else:
        a, b = fib(n // 2)
        c = ((a%m) * ((b%m) * 2 - (a%m)))%m
        d = ((a%m) * (a%m))%m + ((b)%m * (b)%m)%m
        if n % 2 == 0:
            return [c, d]
        else:
            return [d, c + d]

def charIN(x= ' '):
    return(sys.stdin.readline().strip().split(x))

def arrIN(x = ' '):
    return list(map(int,sys.stdin.readline().strip().split(x)))

def ncr(n,r):
    num=den=1
    for i in range(r):
        num = (num*(n-i))%MOD
        den = (den*(i+1))%MOD

    return (num*(pow(den,MOD-2,MOD)))%MOD

def flush():
    return sys.stdout.flush()

'''*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*'''
for _ in range(int(input())):
    a,b = arrIN()
    d = abs(a-b)
    ans = 0
    x,y = divmod(d,5)
    ans+=x
    z,w = divmod(y,2)
    ans+=z
    ans+=w
    print(ans)


t=int(input())
while(t):
    t-=1
    a,b=map(int,input().split())
    if a>b:
        a,b=b,a
    d=b-a
    ans=0
    if(d>=5):
        ans+=d//5
        d%=5
    if(d>=2):
        ans+=d//2
        d%=2
    if(d>=1):
        ans+=d
    print(ans)

def ii(): return int(input())
def si(): return input()
def mi(): return list(map(int,input().strip().split(" ")))
def li(): return list(mi())
mod=1e9
t=ii()
while(t):
    t-=1
    a,b=mi()
    x=abs(b-a)
    c=x//5
    x=x%5
    c+=x//2
    x%=2
    c+=x
    print(c)
    


for i in ' '*int(input()):
    a,b=map(int,input().split())
    k=abs(b-a)
    c=0
    c+=k//5
    k%=5
    if k>3:
        c+=1
        k=5-k
    c+=k//2
    k%=2
    c+=k
    print(c)

import sys
import math
import itertools
import collections


def sieve(n):
    if n < 2: return list()
    prime = [True for _ in range(n + 1)]
    p = 3
    while p * p <= n:
        if prime[p]:
            for i in range(p * 2, n + 1, p):
                prime[i] = False
        p += 2
    r = [2]
    for p in range(3, n + 1, 2):
        if prime[p]:
            r.append(p)
    return r
def divs(n, start=1):
    r = []
    for i in range(start, int(math.sqrt(n) + 1)):
        if (n % i == 0):
            if (n / i == i):
                r.append(i)
            else:
                r.extend([i, n // i])
    return r
def cdiv(n, k): return n // k + (n % k != 0)
def ii(): return int(input())
def mi(): return list(map(int, input().split()))
def li(): return list(map(int, input().split()))
def lcm(a, b): return abs(a * b) // math.gcd(a, b)
def wr(arr): return ''.join(map(str, arr))
def revn(n): return str(n)[::-1]
def prime(n):
    if n == 2: return True
    if n % 2 == 0 or n <= 1: return False
    sqr = int(math.sqrt(n)) + 1
    for d in range(3, sqr, 2):
        if n % d == 0: return False
    return True
def convn(number, base):
    newnumber = 0
    while number > 0:
        newnumber += number % base
        number //= base
    return newnumber


t = ii()
for _ in range(t):
    a, b = mi()
    d = abs(b - a)
    ans = 0
    ans += d // 5
    d %= 5
    ans += d // 2
    d %= 2
    ans += d
    print(ans)


for i in range(int(input())):
    a,b=list(map(int,input().split()))
    a=-min(a,b)+max(a,b)
    ans=0
    ans= a//5
    a%=5
    ans+=a//2
    a%=2
    ans+=a
    print(ans)


for _ in range(int(input())):
    a, b = list(map(int, input().split()))
    a = abs( a - b )
    c = a // 5
    a -= c * 5
    print( c + a // 2 + a % 2 )


for _ in range(int(input())):
    a,b=list(map(int,input().split()))
    target=abs(a-b)
    res=0

    res+=target//5;target=target%5
    res+=target//2;target=target%2
    res+=target//1;target=target%1

    print(res)


#JMD
#Nagendra Jha-4096

 
import sys
import math

#import fractions
#import numpy
 
###File Operations###
fileoperation=0
if(fileoperation):
    orig_stdout = sys.stdout
    orig_stdin = sys.stdin
    inputfile = open('W:/Competitive Programming/input.txt', 'r')
    outputfile = open('W:/Competitive Programming/output.txt', 'w')
    sys.stdin = inputfile
    sys.stdout = outputfile

###Defines...###
mod=1000000007
 
###FUF's...###
def nospace(l):
    ans=''.join(str(i) for i in l)
    return ans
 
 
 
##### Main ####
t=int(input())
for tt in range(t):
    #n=int(input())
    a,b= map(int, sys.stdin.readline().split(' '))
    ans=0
    if(a>b):
        temp=b
        b=a
        a=temp
    diff=b-a
    ans+=(diff//5)
    diff%=5
    ans+=(diff//2)
    diff%=2
    ans+=diff
    print(ans)
    #a=list(map(int,sys.stdin.readline().split(' ')))
    
    
#####File Operations#####
if(fileoperation):
    sys.stdout = orig_stdout
    sys.stdin = orig_stdin
    inputfile.close()
    outputfile.close()

for _ in range(int(input())):
    a,b=list(map(int,input().split()))
    x=min(a,b)
    y=max(a,b)
    c=0
    if x==y:
        print(0)
    else:
        c+=(y-x)//5
        rem=(y-x)%5
        c+=rem//2
        rem=rem%2
        c+=rem
        print(c)


n = int(input())
for i in range(n):
	x, y = list(map(int, input().split()))
	if x > y:
		x, y = y, x
	a = (y - x) // 5
	x += a * 5
	b = (y - x) // 2
	x += b * 2
	c = (y - x)
	print(a + b + c)


t = int(input())

for _ in range(t):
	a, b = map(int, input().split())
	diff = abs(a-b)
	fives = diff//5
	diff %= 5
	twos = diff//2
	diff %= 2
	ones = diff

	print(fives+twos+ones)

n=int(input())
for i in range(n):
    a,b=[int(x) for x in input().split(' ')]
    c=abs(a-b)
    d=0
    d+=int(c/5)
    c=c%5
    d+=int(c/2)
    c=c%2
    d+=c
    print(d)


import io, sys, atexit, os
import math as ma
from decimal import Decimal as dec
from itertools import permutations
from itertools import combinations


def li():
    return list(map(int, sys.stdin.readline().split()))


def num():
    return map(int, sys.stdin.readline().split())


def nu():
    return int(input())


def find_gcd(x, y):
    while (y):
        x, y = y, x % y
    return x


def lcm(x, y):
    gg = find_gcd(x, y)
    return (x * y // gg)


mm = 1000000007


def solve():
    t = nu()
    for tt in range(t):
        a,b=num()
        if(a<=b):
            dd=b-a
            pq=dd//5
            yp=dd%5
            yo=yp//2
            yu=yp%2
            print(pq+yu+yo)
        else:
            a,b=b,a
            dd = b - a
            pq = dd // 5
            yp = dd % 5
            yo = yp // 2
            yu = yp % 2
            print(pq + yu + yo)


def __starting_point():
    solve()
__starting_point()

n = int(input())
for i in range(n):
    a, b = map(int, input().split())
    s = abs(a - b)
    x = s // 5
    s %= 5
    x += s // 2
    s %= 2
    x += s
    print(x)

T = int(input())

for _ in range(T):
	a, b = map(int, input().split())

	d = abs(a - b)

	ans = (d // 5)

	d = d % 5

	if d == 1 or d == 2:
		ans += 1

	if d == 3 or d == 4:
		ans += 2

	print(ans)

for _ in range(int(input())):
    a,b=map(int,input().split())
    d=abs(a-b)
    ans=0
    sm=0 
    ans+=(d//5)
    d%=5 
    ans+=(d//2)
    d%=2 
    ans+=d 
    print(ans)