You are given two integers $a$ and $b$.

In one move, you can choose some integer $k$ from $1$ to $10$ and add it to $a$ or subtract it from $a$. In other words, you choose an integer $k \in [1; 10]$ and perform $a := a + k$ or $a := a - k$. You may use different values of $k$ in different moves.

Your task is to find the minimum number of moves required to obtain $b$ from $a$.

You have to answer $t$ independent test cases.


-----Input-----

The first line of the input contains one integer $t$ ($1 \le t \le 2 \cdot 10^4$) — the number of test cases. Then $t$ test cases follow.

The only line of the test case contains two integers $a$ and $b$ ($1 \le a, b \le 10^9$).


-----Output-----

For each test case, print the answer: the minimum number of moves required to obtain $b$ from $a$.


-----Example-----
Input
6
5 5
13 42
18 4
1337 420
123456789 1000000000
100500 9000

Output
0
3
2
92
87654322
9150



-----Note-----

In the first test case of the example, you don't need to do anything.

In the second test case of the example, the following sequence of moves can be applied: $13 \rightarrow 23 \rightarrow 32 \rightarrow 42$ (add $10$, add $9$, add $10$).

In the third test case of the example, the following sequence of moves can be applied: $18 \rightarrow 10 \rightarrow 4$ (subtract $8$, subtract $6$).

Difficulty: EASY

Solutions:
t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	else:
		c = abs(a - b)
		if c % 10 == 0:
			print(c // 10)
		else:
			c = c // 10 + 1
			print(c)


def solve():
	(a, b) = map(int, input().split())
	c = abs(b - a)
	k = 0
	k += c // 10
	if c % 10 != 0:
		k += 1
	print(k)
for _ in range(int(input())):
	solve()


import math
t = int(input())
while t:
	t = t - 1
	(a, b) = map(int, input().split())
	print(math.ceil(abs(a - b) / 10))


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	dif = abs(a - b)
	print((dif + 9) // 10)


import bisect
import collections
import functools
import itertools
import math
import heapq
import random
import string

def repeat(_func=None, *, times=1):

	def decorator(func):

		@functools.wraps(func)
		def wrapper(*args, **kwargs):
			for _ in range(times):
				func(*args, **kwargs)
		return wrapper
	if _func is None:
		return decorator
	else:
		return decorator(_func)

def unpack(func=int):
	return map(func, input().split())

def l_unpack(func=int):
	return list(map(func, input().split()))

def s_unpack(func=int, rev=False):
	return sorted(map(func, input().split()), reverse=rev)

def ml_unpack(n):
	return [int(input()) for _ in range(n)]

def range_n():
	return range(int(input()))

def getint():
	return int(input())

def factor(n):
	d = {}
	while not n % 2:
		d[2] = d.get(2, 0) + 1
		n //= 2
	i = 3
	while i * i <= n:
		while not n % i:
			d[i] = d.get(i, 0) + 1
			n //= i
		i += 2
	if n > 1:
		d[n] = d.get(n, 0) + 1
	return d

def get_sum(a):
	ans = 0
	n = len(a)
	for i in range(n):
		ans += (i - (n - i - 1)) * a[i]
	return ans

@repeat(times=getint())
def main():
	(a, b) = unpack()
	if a == b:
		print(0)
	elif a < b:
		b -= a
		ans = b // 10
		ans += 1 if b % 10 else 0
		print(ans)
	else:
		a -= b
		ans = a // 10
		ans += 1 if a % 10 else 0
		print(ans)
main()


n = int(input())
for i in range(n):
	(a, b) = map(int, input().split())
	import math
	print(math.ceil(abs(a - b) / 10))


from math import ceil
for ii in range(int(input())):
	(n, m) = map(int, input().split())
	dif = ceil(abs(n - m) / 10)
	print(dif)


from math import ceil
t = int(input())
while t != 0:
	(a, b) = map(int, input().split())
	if a < b:
		(a, b) = (b, a)
	print(ceil((a - b) / 10))
	t -= 1


t = int(input())
while t > 0:
	x = input().split()
	a = int(x[0])
	b = int(x[1])
	ans = abs(a - b)
	curr = ans // 10
	if ans % 10 != 0:
		curr += 1
	print(curr)
	t -= 1


import math
from collections import defaultdict
for _ in range(int(input())):
	(a, b) = list(map(int, input().split()))
	if a == b:
		print(0)
	else:
		s = 0
		k = abs(b - a)
		a10 = k % 10
		s += k // 10
		k = a10
		a9 = k % 9
		s += k // 9
		k = a9
		a8 = k % 8
		s += k // 8
		k = a8
		a7 = k % 7
		s += k // 7
		k = a7
		a6 = k % 6
		s += k // 6
		k = a6
		a5 = k % 5
		s += k // 5
		k = a5
		a4 = k % 4
		s += k // 4
		k = a4
		a3 = k % 3
		s += k // 3
		k = a3
		a2 = k % 2
		s += k // 2
		k = a2
		a1 = k % 1
		s += k // 1
		k = a1
		print(s)


t = int(input())
import math
while t > 0:
	(n, m) = map(int, input().split())
	print(math.ceil(abs(n - m) / 10))
	t -= 1


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	c = abs(a - b)
	c1 = c // 10
	if c % 10:
		c1 += 1
	print(c1)


def fun(a, b):
	if b == a:
		return 0
	if a > b:
		(a, b) = (b, a)
	diff = b - a
	if diff % 10 == 0:
		return diff // 10
	else:
		return diff // 10 + 1
t = int(input())
for i in range(t):
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	print(fun(a, b))


t = int(input())
k = [i for i in range(1, 10)]
k.sort(reverse=True)
for _ in range(t):
	(a, b) = map(int, input().split())
	c = abs(a - b)
	cnt = 0
	if c % 10 == 0:
		cnt = c // 10
	else:
		cnt = c // 10 + 1
	print(cnt)


import sys, math, collections
from collections import defaultdict

def file():
	sys.stdin = open('input.py', 'r')
	sys.stdout = open('output.py', 'w')

def get_array():
	l = list(map(int, input().split()))
	return l

def get_2_ints():
	(a, b) = map(int, input().split())
	return (a, b)

def get_3_ints():
	(a, b, c) = map(int, input().split())
	return (a, b, c)

def sod(n):
	(n, c) = (str(n), 0)
	for i in n:
		c += int(i)
	return c

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def getFloor(A, x):
	(left, right) = (0, len(A) - 1)
	floor = -1
	while left <= right:
		mid = (left + right) // 2
		if A[mid] == x:
			return A[mid]
		elif x < A[mid]:
			right = mid - 1
		else:
			floor = A[mid]
			left = mid + 1
	return floor

def chk(l, n):
	s = 0
	o = 0
	for i in range(len(l)):
		s += l[i]
		if s > n:
			return 0
		if s == n:
			ind = i
			o = 1
			break
	if o:
		return sum(l[ind + 1:]) == n

def main():
	for tt in range(int(input())):
		(a, b) = get_2_ints()
		if a > b:
			n = a - b
		elif a < b:
			n = b - a
		else:
			n = 0
		c = 0
		while n != 0:
			if n >= 10:
				t = n // 10
				n = n - t * 10
				c += t
			elif n >= 9:
				t = n // 9
				n = n - t * 9
				c += t
			elif n >= 8:
				t = n // 8
				n = n - t * 8
				c += t
			elif n >= 7:
				t = n // 7
				n = n - t * 7
				c += t
			elif n >= 6:
				t = n // 6
				n = n - t * 6
				c += t
			elif n >= 5:
				t = n // 5
				n = n - t * 5
				c += t
			elif n >= 4:
				t = n // 4
				n = n - t * 4
				c += t
			elif n >= 3:
				t = n // 3
				n = n - t * 3
				c += t
			elif n >= 2:
				t = n // 2
				n = n - t * 2
				c += t
			elif n >= 1:
				t = n // 1
				n = n - t * 1
				c += t
		print(c)
main()


t = int(input())
while t:
	(a, b) = map(int, input().split())
	rem = max(a, b) - min(a, b)
	if rem % 10 == 0:
		ans = rem // 10
	else:
		ans = rem // 10 + 1
	print(ans)
	t -= 1


n = int(input())
for i in range(n):
	(a, b) = map(int, input().split())
	diff = abs(a - b)
	v = diff / 10
	if v > int(v):
		result = int(v) + 1
		print(int(result))
	else:
		print(int(v))


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	diff = abs(b - a)
	ans = diff // 10
	if diff % 10:
		ans += 1
	print(ans)


import sys
input = lambda : sys.stdin.readline().rstrip('\r\n')

def solve():
	(a, b) = map(int, input().split())
	(x, y) = (min(a, b), max(a, b))
	y -= x
	ans = y // 10 if y % 10 == 0 else y // 10 + 1
	print(ans)
for _ in range(int(input())):
	solve()


import sys
input = lambda : sys.stdin.readline().rstrip()
from collections import deque
from queue import LifoQueue
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	c = abs(b - a)
	ans = 0
	ans += c // 10
	if c % 10 != 0:
		ans += 1
	print(ans)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
		continue
	else:
		(c, d) = divmod(abs(b - a), 10)
		if d != 0:
			print(c + 1)
		else:
			print(c)


rw = int(input())
for wewq in range(rw):
	(a, b) = map(int, input().split())
	d = abs(a - b)
	print((d + 9) // 10)


def solve():
	num = int(input())
	while num > 0:
		num -= 1
		(a, b) = map(int, input().split())
		depth = 0
		while a != b:
			if (b - a) // 10 > 0:
				temp = (b - a) // 10
				a += 10 * temp
				depth += temp
			elif -((a - b) // 10) // 10 < 0:
				temp = -((a - b) // 10)
				a += 10 * temp
				depth -= temp
			else:
				a += b - a
				depth += 1
		print(depth)
solve()


import sys
input = sys.stdin.readline

def print(val):
	sys.stdout.write(str(val) + '\n')

def prog():
	for _ in range(int(input())):
		(a, b) = map(int, input().split())
		if a == b:
			print(0)
		else:
			if a < b:
				(a, b) = (b, a)
			print((a - b + 9) // 10)
prog()


T = int(input())
ret = []
for t in range(T):
	(a, b) = map(int, input().split())
	ans = abs(a - b) // 10
	if abs(a - b) % 10 != 0:
		ans += 1
	ret.append(ans)
for t in range(T):
	print(ret[t])


N = int(input())
Ans = []
for i in range(N):
	(a, b) = map(int, input().split())
	if abs(b - a) % 10 == 0:
		Ans.append(abs(b - a) // 10)
	else:
		Ans.append(abs(b - a) // 10 + 1)
for i in Ans:
	print(i)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	ans = abs(a - b) // 10
	if abs(a - b) % 10 > 0:
		ans += 1
	print(ans)


from math import gcd, ceil
N = int(input())
for i in range(N):
	l = list(map(int, input().split()))
	l.sort()
	(a, b) = l
	print(ceil((b - a) / 10))


t = int(input())
while t > 0:
	(a, b) = [int(x) for x in input().split()]
	temp = abs(a - b)
	if temp % 10 == 0:
		print(temp // 10)
	else:
		print(temp // 10 + 1)
	t -= 1


import sys
input = sys.stdin.readline
ins = lambda : input().rstrip()
ini = lambda : int(input().rstrip())
inm = lambda : map(int, input().rstrip().split())
inl = lambda : list(map(int, input().split()))
out = lambda x, s='\n': print(s.join(map(str, x)))
t = ini()
for _ in range(t):
	(a, b) = inm()
	tmp = abs(a - b)
	if tmp == 0:
		print(0)
	else:
		print((tmp + 9) // 10)


import math
t = int(input())
while t > 0:
	l = input().split()
	a = int(l[0])
	b = int(l[1])
	mov = math.ceil(math.fabs(b - a) / 10)
	print(mov)
	t = t - 1


import math
rr = lambda : input().strip()
rrm = lambda : map(int, rr().split())
T = int(rr())
for _ in range(T):
	(a, b) = rrm()
	ans = math.ceil(abs(a - b) / 10)
	print(ans)


for i in range(int(input())):
	(a, b) = map(int, input().split())
	if a == b:
		n = 0
	elif abs(a - b) <= 10:
		n = 1
	else:
		n = abs(a - b) // 10
		if abs(a - b) % 10 != 0:
			n += 1
	print(n)


t = int(input())
h = ''
for t in range(t):
	(a, b) = map(int, input().split())
	if a > b:
		f = a - b
	else:
		f = b - a
	j = f // 10
	if f % 10 > 0:
		j += 1
	h += str(j) + '\n'
print(h[:-1])


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	(a, b) = (max(a, b), min(a, b))
	print((a - b) // 10 + int(bool((a - b) % 10)))


from math import *
import sys
n = int(input())
for i in range(n):
	(a, b) = map(int, input().split())
	d = abs(a - b)
	print(d // 10 + (1 if d % 10 != 0 else 0))


import math
import collections
from sys import stdin, stdout, setrecursionlimit
from bisect import bisect_left as bsl
from bisect import bisect_right as bsr
import heapq as hq
setrecursionlimit(2 ** 20)
t = 1
t = int(stdin.readline())
for _ in range(t):
	(a, b) = list(map(int, stdin.readline().rstrip().split()))
	(a, b) = (min(a, b), max(a, b))
	ans = 0
	ans += abs(a - b) // 10
	if (b - a) % 10 != 0:
		ans += 1
	print(ans)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	(a, b) = (min(a, b), max(a, b))
	ans = abs(b - a) // 10
	if abs(b - a) % 10:
		ans += 1
	print(ans)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	diff = abs(a - b)
	if diff % 10:
		print(diff // 10 + 1)
	else:
		print(diff // 10)


for i in range(int(input())):
	(a, b) = map(int, input().split())
	c = abs(b - a)
	s = 0
	for i in range(10, 0, -1):
		s += c // i
		c = c - c // i * i
	print(s)


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	c = abs(a - b)
	if c % 10 == 0:
		print(c // 10)
	else:
		print(c // 10 + 1)


t = int(input())
for _ in range(t):
	(a, b) = [int(s) for s in input().split(' ')]
	if a == b:
		print(0)
	elif abs(b - a) % 10 == 0:
		print(abs(b - a) // 10)
	else:
		print(abs(b - a) // 10 + 1)


def solve():
	(a, b) = list(map(int, input().split()))
	diff = b - a
	if diff == 0:
		print(0)
	else:
		if diff < 0:
			diff = -diff
		if diff % 10 == 0:
			ans = int(diff / 10)
			print(ans)
		else:
			ans = int(diff / 10) + 1
			print(ans)
	return
t = int(input())
while t != 0:
	solve()
	t -= 1


import math
cases = int(input())
for t in range(cases):
	(a, b) = list(map(int, input().split()))
	diff = abs(a - b)
	output = math.ceil(diff / 10)
	print(output)


import sys
from collections import defaultdict as dd
from collections import Counter as cc
from queue import Queue
import math
import itertools
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass
input = lambda : sys.stdin.buffer.readline().rstrip()
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	(a, b) = (max(a, b), min(a, b))
	if (a - b) % 10 == 0:
		print((a - b) // 10)
	else:
		print((a - b) // 10 + 1)


import math
t = int(input())
for w in range(t):
	(a, b) = (int(i) for i in input().split())
	k = abs(b - a) // 10
	if abs(b - a) % 10 == 0:
		print(k)
	else:
		print(k + 1)


c = []
for i in range(int(input())):
	(a, b) = map(int, input().split())
	sum = 0
	sum += abs(a - b) // 10
	if abs(a - b) % 10 != 0:
		sum += 1
	c.append(sum)
for k in c:
	print(k)


for t in range(int(input())):
	(a, b) = sorted(map(int, input().split()))
	d = b - a
	ans = d // 10 + int(bool(d % 10))
	print(ans)


def thief():
	comb = input().split(' ')
	for i in range(4):
		for j in range(4):
			for l in range(4):
				for u in range(4):
					print(comb[i], comb[j], comb[l], comb[u])

def thief2():
	comb = input().split(' ')
	for i in range(4):
		for j in range(4):
			for l in range(4):
				for u in range(4):
					if j != i and j != l and (j != u) and (j != l) and (l != u):
						print(comb[i], comb[j], comb[l], comb[u])

def palindrome():
	string2 = ''
	string3 = ''
	string1 = input()
	string = []
	string[:] = string1
	for i in range(len(string)):
		string2 += string[len(string) - i - 1]
	if string2 == string1:
		print('yes')
	else:
		print('no')

def sort():
	list = input().split()
	bool1 = input('enter true for ascending order and false for descending order')
	if bool1 == 'true':
		list.sort()
	else:
		list.sort(reverse=True)
	print(list)

def sing():
	for i in range(10):
		print(10 - i, ' green bottles hanging on the wall ', 10 - i, ' green bottles hanging on the wall,And if one green bottle should accidentally fall,Therell be ', 10 - i - 1, ' green bottles hanging on the wall.')

def twoint():
	n = int(input())
	list1 = []
	for i in range(n):
		list1.append(input().split())
	for i in range(n):
		a = int(list1[i][0])
		b = int(list1[i][1])
		if a > b:
			if (a - b) % 10 == 0:
				print((a - b) // 10)
			else:
				print((a - b) // 10 + 1)
		elif (b - a) % 10 == 0:
			print((b - a) // 10)
		else:
			print((b - a) // 10 + 1)
twoint()


z = int(input())
for _ in range(z):
	ans = 0
	(x, y) = list(map(int, input().split()))
	if x == y:
		print(0)
	else:
		diff = abs(x - y)
		ans += int(diff / 10)
		if diff % 10 > 0:
			ans += 1
		print(ans)


T = int(input())
for t in range(T):
	s = input().split()
	a = int(s[0])
	b = int(s[1])
	diff = abs(a - b)
	result = 0
	result += diff // 10
	if diff % 10 > 0:
		result += 1
	print(result)


tests = int(input())
for i in range(tests):
	(a, b) = map(int, input().split())
	c = abs(b - a)
	d = c // 10
	if d == 0 and c % 10 == 0:
		print(d)
	elif d == 0 and c % 10 != 0:
		print(d + 1)
	elif c % 10 == 0:
		print(d)
	else:
		d += 1
		print(d)


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	ans = abs(b - a) // 10
	maxi = max(a, b)
	mini = min(a, b)
	if maxi - 10 * ans - mini != 0:
		ans += 1
	print(ans)


import math

def inp():
	return int(input())

def insr():
	s = input()
	return s

def inlt():
	return list(map(int, input().split()))

def f(a, b):
	return math.ceil((max(a, b) - min(a, b)) / 10)
r = inp()
for i in range(r):
	l2 = inlt()
	print(f(l2[0], l2[1]))


import math
for i in range(int(input())):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	else:
		c = abs(a - b)
		d = math.ceil(c / 10)
		print(d)


t = int(input())
while t > 0:
	(a, b) = [int(y) for y in input().split()]
	x = abs(b - a) // 10
	if abs(b - a) % 10 > 0:
		x += 1
	print(x)
	t -= 1


n = int(input())
for i in range(n):
	a = input().split()
	b = int(a[1])
	a = int(a[0])
	aux = (b - a + 9) / 10 if a <= b else (a - b + 9) / 10
	print(int(aux))


import os
import sys
from io import BytesIO, IOBase

def solution(a, b):
	if a == b:
		write(0)
		return
	diff = abs(a - b)
	res = diff // 10
	write(res if diff % 10 == 0 else res + 1)

def main():
	for _ in range(r_int()):
		(a, b) = r_array()
		solution(a, b)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')

def write(*args, end='\n'):
	for x in args[:-1]:
		sys.stdout.write(str(x) + ' ')
	sys.stdout.write(str(args[-1]))
	sys.stdout.write(end)

def r_array():
	return [int(x) for x in input().split()]

def r_int():
	return int(input())
main()


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	otv = 0
	r = abs(a - b)
	otv += r // 10
	r = r % 10
	otv += r // 9
	r = r % 9
	otv += r // 8
	r = r % 8
	otv += r // 7
	r = r % 7
	otv += r // 6
	r = r % 6
	otv += r // 5
	r = r % 5
	otv += r // 4
	r = r % 4
	otv += r // 3
	r = r % 3
	otv += r // 2
	r = r % 2
	otv += r // 1
	r = r % 1
	print(otv)


T = int(input())
while T > 0:
	(a, b) = map(int, input().split())
	res = 0
	if a > b:
		temp = a - b
		res += temp // 10
		if temp % 10 != 0:
			res += 1
	else:
		temp = b - a
		res += temp // 10
		if temp % 10 != 0:
			res += 1
	print(res)
	T -= 1


for i in range(int(input())):
	(a, b) = [int(i) for i in input().split()]
	x = abs(b - a) + 9
	print(x // 10)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if a > b:
		(a, b) = (b, a)
	n = a + (b - a) // 10 * 10
	if n == b:
		print((b - a) // 10)
	else:
		print((b - a) // 10 + 1)


for t in range(int(input())):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
		continue
	s = 0
	(a, b) = (min(b, a), max(b, a))
	m = b - a
	s = s + m // 10
	a = a + m // 10 * 10
	if a == b:
		print(s)
	else:
		print(s + 1)


t = int(input())
for _ in range(t):
	ar = list(map(int, input().split()))
	d = abs(ar[0] - ar[1])
	if d % 10 == 0:
		print(d // 10)
	else:
		print(d // 10 + 1)


import sys, bisect
from sys import stdin, stdout
from bisect import bisect_left, bisect_right, bisect, insort, insort_left, insort_right
from math import gcd, ceil, floor, sqrt
from collections import Counter, defaultdict, deque, OrderedDict
from queue import Queue, PriorityQueue
from string import ascii_lowercase
dx = [-1, 1, 0, 0]
dy = [0, 0, 1, -1]
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 998244353
mod = 10 ** 9 + 7

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	for i in range(5, ceil(sqrt(n)) + 1, 6):
		if n % i == 0 or n % (i + 2) == 0:
			return False
	return True

def st():
	return list(stdin.readline().strip())

def inp():
	return int(stdin.readline())

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

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

def pr(n):
	stdout.write(str(n) + '\n')

def solve():
	(a, b) = mp()
	x = abs(a - b)
	print(ceil(x / 10))
for _ in range(inp()):
	solve()


n = int(input())
for i in range(n):
	(start, finish) = map(int, input().split())
	dist = finish - start
	if dist < 0:
		dist *= -1
	res = dist // 10
	if dist % 10 != 0:
		res += 1
	print(res)


tests = int(input())
for i in range(tests):
	vals = input().split(' ')
	a = int(vals[0])
	b = int(vals[1])
	d = abs(a - b)
	if d % 10 == 0:
		print(d // 10)
	else:
		print(d // 10 + 1)


for _ in range(int(input())):
	l = list(map(int, input().split()))
	a = l[0]
	b = l[1]
	if b > a:
		(a, b) = (b, a)
	x = a - b
	if x % 10 == 0:
		print(int(x / 10))
	else:
		print(x // 10 + 1)


import math
a = int(input())
b = []
for i in range(a):
	(c, d) = map(int, input().split())
	c = abs(c - d) / 10
	c = math.ceil(c)
	b.append(c)
for i in range(a):
	print(b[i])


q = int(input())
for _ in range(q):
	[a, b] = list(map(int, input().split()))
	c = int(0)
	if a > b:
		c = a - b
	else:
		c = b - a
	if c % 10 == 0:
		ans = int(c / 10)
		print(ans)
	else:
		ans = int(c / 10)
		ans = ans + 1
		print(ans)


for _ in range(int(input())):
	(a, b) = (int(i) for i in input().split(' '))
	c = abs(b - a)
	if c // 10 == c / 10:
		print(c // 10)
	else:
		print(c // 10 + 1)


from math import gcd
from collections import defaultdict
t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	if a < b:
		(a, b) = (b, a)
	if a == b:
		print(0)
	else:
		r = (a - b) % 10
		if r == 0:
			print((a - b) // 10)
		else:
			print((a - b) // 10 + 1)


n = int(input())
for x in range(n):
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	print((max(a, b) - min(a, b)) // 10 + (1 if (max(a, b) - min(a, b)) % 10 != 0 else 0))


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


for _ in range(int(input())):
	a = list(map(int, input().split()))
	b = abs(a[0] - a[1])
	c = b // 10
	d = b % 10
	if d:
		d = 1
	print(c + d)


n = int(input())
for i in range(n):
	k = list(map(int, input().strip().split()))
	if k[0] >= k[1]:
		c = 0
		a = []
		if k[0] - k[1] <= 10 and k[1] != k[0]:
			print(1)
		if k[1] - k[0] <= 10 and k[1] == k[0]:
			print(0)
		if k[0] - k[1] > 10:
			t = k[0] - k[1]
			p = t % 10
			z = k[0] - p
			l = z - k[1]
			if l + k[1] == k[0]:
				print(l // 10)
			else:
				print(l // 10 + 1)
	if k[1] > k[0]:
		c = 0
		a = []
		if k[1] - k[0] <= 10 and k[0] != k[1]:
			print(1)
		if k[1] - k[0] > 10:
			t = k[1] - k[0]
			p = t % 10
			z = k[1] - p
			l = z - k[0]
			if l + k[0] == k[1]:
				print(l // 10)
			else:
				print(l // 10 + 1)


T = int(input())
for _ in range(T):
	(a, b) = map(int, input().split())
	cnt = 0
	if a > b:
		cnt += (a - b) // 10
		if (a - b) % 10:
			cnt += 1
	elif a < b:
		cnt += (b - a) // 10
		if (b - a) % 10:
			cnt += 1
	print(cnt)


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	count = 0
	if a == b:
		print(0)
	else:
		diff = abs(a - b)
		if diff < 10:
			count = 1
		elif diff % 10 != 0:
			count = diff // 10
			count += 1
		else:
			count = diff // 10
		print(count)


def solve():
	inpu = list(map(int, input().strip().split()))
	(a, b) = (inpu[0], inpu[1])
	if a == b:
		print(0)
		return 0
	elif b > a:
		count = 0
		ten = int((b - a) / 10)
		a = a + ten * 10
		count += ten
		if a == b:
			print(count)
			return 0
		a = a + (b - a)
		count += 1
		print(count)
		return 0
	elif a > b:
		count = 0
		ten = int((a - b) / 10)
		a = a - ten * 10
		count += ten
		if a == b:
			print(count)
			return 0
		a = a - (a - b)
		count += 1
		print(count)
		return 0
t = int(input())
while t > 0:
	solve()
	t -= 1


import math
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	print(math.ceil(abs(b - a) / 10))


def main():
	t = int(input())
	for _ in range(t):
		(a, b) = map(int, input().split())
		diff = abs(a - b)
		moves = int(diff / 10)
		diff = diff % 10
		if diff > 0:
			moves += 1
		print(moves)
main()


import math
t = int(input())
answer = list()
for test_case in range(t):
	a = input()
	a = a.split()
	b = int(a[1])
	a = int(a[0])
	answer.append(math.ceil(abs(a - b) / 10))
for i in answer:
	print(i)


for i in range(int(input())):
	(a, b) = map(int, input().split())
	x = abs(b - a)
	an = x // 10 + int(x % 10 != 0)
	print(an)


import math
cases = int(input(''))
output = []
for case in range(cases):
	x = input('').split()
	list1 = []
	counter = 0
	for c in range(len(x)):
		list1.append(int(x[c]))
	list1.sort()
	if list1[0] == list1[1]:
		output.append(0)
		continue
	else:
		result = math.ceil((list1[1] - list1[0]) / 10)
		output.append(result)
print(*output, sep='\n')


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	else:
		diff = max(a, b) - min(a, b)
		print((diff - 1) // 10 + 1)


import math
t = int(input())
result = []
for i in range(t):
	counter = 0
	(a, b) = input().split()
	(a, b) = (int(a), int(b))
	if a == b:
		result.append(0)
	else:
		counter = math.ceil(abs(a - b) / 10)
		result.append(counter)
for i in range(t):
	print(result[i])


t = int(input())
for i in range(t):
	(m, n) = map(int, input().strip().split())
	if m == n:
		print(0)
	else:
		res = abs(m - n)
		if res % 10 == 0:
			print(res // 10)
		else:
			print(res // 10 + 1)


from math import ceil
n = int(input())
ans = []
for i in range(n):
	(a, b) = [int(i) for i in input().split()]
	ans.append(ceil(abs(a - b) / 10))
for i in ans:
	print(i)


t = int(input())
for test in range(t):
	(a, b) = map(int, input().split())
	x = abs(a - b)
	n = x // 10
	if x % 10 != 0:
		n += 1
	print(n)


import math

def solve():
	(a, b) = [int(v) for v in input().split()]
	print(math.ceil(abs(a - b) / 10))
t = int(input())
for _ in range(t):
	solve()


import math

def solve():
	(a, b) = map(int, input().split())
	print(int(math.ceil(abs(a - b) / 10)))
T = int(input())
for _ in range(T):
	solve()


test = int(input())
for i in range(test):
	(x, y) = map(int, input().split())
	c = 0
	if abs(x - y) <= 10 and abs(x - y) != 0:
		print(1)
	elif abs(x - y) == 0:
		print(0)
	else:
		if abs(x - y) % 10 == 0:
			c = abs(x - y) // 10
		else:
			c = abs(x - y) // 10
			c += 1
		print(c)


t = int(input())
while t > 0:
	t = t - 1
	(a, b) = [int(i) for i in input().split()]
	if a == b:
		ans = 0
	else:
		diff = abs(b - a)
		coeff = diff // 10
		if diff == 10 * coeff:
			ans = coeff
		else:
			ans = coeff + 1
	print(ans)


for i in range(int(input())):
	(a, b) = sorted(map(int, input().split()))
	s = [10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
	c = b - a
	cnt = 0
	for i in s:
		cnt = c // i
		c -= c // i
	print(cnt)


import math
t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	st = 0
	if a > b:
		st = a - b
	else:
		st = b - a
	ans = st / 10
	print(math.ceil(ans))


T = int(input())
for z in range(T):
	(a, b) = [int(x) for x in input().split()]
	diss = abs(a - b)
	steps = diss // 10
	if diss % 10 != 0:
		steps += 1
	print(steps)


import sys

class AYetAnotherTwoIntegersProblem:

	def solve(self, tc=0):
		for _ in range(int(input())):
			(a, b) = [int(_) for _ in input().split()]
			print(abs(b - a) // 10 + int(abs(b - a) % 10 != 0))
solver = AYetAnotherTwoIntegersProblem()
input = sys.stdin.readline
solver.solve()


import math
K = int(input())
T = []
for i in range(0, K):
	a = input()
	b = int(a.split(' ')[0])
	c = int(a.split(' ')[1])
	T.append(math.ceil(abs(c - b) / 10))
for i in T:
	print(i)


n = int(input())
resp = []
for i in range(n):
	valores = [int(i) for i in input().split()]
	dif = max(valores) - min(valores)
	if dif % 10 == 0:
		pasosj = dif // 10
	else:
		pasosj = dif // 10 + 1
	resp.append(pasosj)
for i in range(n):
	print(resp[i])


import math
t = int(input().strip())
for _ in range(t):
	(a, b) = map(int, input().strip().split())
	diff = abs(a - b)
	ans = 0
	if diff == 0:
		ans = 0
	else:
		ans = math.ceil(diff / 10)
	print(ans)


t = int(input())
while t > 0:
	t -= 1
	(a, b) = [int(i) for i in input().split()]
	diff = abs(a - b)
	if diff == 0:
		print(0)
		continue
	count = diff // 10
	if diff % 10 != 0:
		count += 1
	print(count)


T = int(input())

def main():
	(a, b) = tuple(map(int, input().split()))
	if a == b:
		return 0
	diff = abs(a - b)
	if diff % 10 == 0:
		return diff // 10
	else:
		return diff // 10 + 1
for _ in range(T):
	print(main())


def main():
	t = int(input())
	for i in range(t):
		(a, b) = map(int, input().split())
		result = find_min_cost_to_transform(a, b, max_k=10)
		print(result)

def find_min_cost_to_transform(a, b, max_k):
	distance = abs(b - a)
	if distance == 0:
		return 0
	return 1 + (distance - 1) // max_k
main()


from sys import stdin, stdout
test = int(stdin.readline())
for _ in range(test):
	(a, b) = map(int, stdin.readline().split())
	ans = abs(b - a) // 10 + int(abs(b - a) % 10 != 0)
	print(ans)


t = int(input())
while t > 0:
	(a, b) = map(int, input().split())
	c = b - a
	q = 0
	if c < 0:
		(a, b) = (b, a)
		c = -c
	k = 0
	if c == 0:
		print('0')
	else:
		q = c // 10
		r = c % 10
		if r > 0:
			print(q + 1)
		else:
			print(q)
	t = t - 1


def result():
	(c, d) = input().split()
	c = int(c)
	d = int(d)
	a = min(c, d)
	b = max(c, d)
	count = 0
	while not a == b:
		diff = b - a
		if diff > 10:
			count = diff // 10
			a = count * 10 + a
		j = 10
		for i in range(0, 10):
			if a + j > b:
				j = j - 1
				continue
			a = a + j
			count = count + 1
	print(count)
t = int(input())
while t > 0:
	result()
	t = t - 1


def minstep(a, b):
	step = 0
	if a > b:
		step = (a - b) // 10
		if (a - b) % 10 != 0:
			step += 1
	elif a == b:
		pass
	else:
		step = (b - a) // 10
		if (b - a) % 10 != 0:
			step += 1
	print(step)
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	minstep(a, b)


t = int(input())
for i in range(t):
	(n, s) = input().split()
	s = int(s)
	n = int(n)
	res = int(abs(n - s))
	rem = int(res % 10)
	if rem != 0:
		rem = 1
	ans = int(res / 10 + rem)
	print(ans)


for i in range(int(input())):
	m = list(map(int, input().split()))
	diff = abs(m[1] - m[0])
	ans = diff // 10
	if diff % 10 != 0:
		ans += 1
	print(ans)


testList = []
number = int(input())
for i in range(number):
	testList.append([int(num) for num in input().split()])
for i in testList:
	col = 0
	if i[0] > i[1]:
		raznitsa = i[0] - i[1]
	elif i[0] < i[1]:
		raznitsa = i[1] - i[0]
	else:
		print(col)
		continue
	col += raznitsa // 10
	raznitsa %= 10
	if raznitsa != 0:
		col += 1
	print(col)


a = int(input())
for item in range(a):
	(a, b) = input().split()
	(a, b) = (int(a), int(b))
	if a == b:
		print(0)
	elif abs(a - b) <= 10:
		print(1)
	elif abs(a - b) % 10 == 0:
		print(abs(a - b) // 10)
	else:
		print(abs(a - b) // 10 + 1)


def find(a, b):
	count = 0
	if a == b:
		return 0
	else:
		x = max(a, b)
		y = min(a, b)
		if (x - y) % 10 == 0:
			return (x - y) // 10
		else:
			return (x - y) // 10 + 1
n = int(input())
for i in range(0, n):
	(a, b) = map(int, input().split())
	print(find(a, b))


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	l = abs(a - b)
	ans = 0
	if l == 0:
		print('0')
	elif l > 0 and l <= 10:
		print('1')
	else:
		ans += l // 10
		if l % 10 == 0:
			print(ans)
		else:
			ans += 1
			print(ans)


T = int(input())
for t in range(T):
	(a, b) = [int(x) for x in input().split()]
	(d, rem) = divmod(abs(a - b), 10)
	if rem > 0:
		print(d + 1)
	else:
		print(d)


import math
ct = input()
for line in range(int(ct)):
	line = [int(i) for i in input().split()]
	print(math.ceil(abs(line[0] - line[1]) / 10))


import os
from heapq import heapify, heappop, heappush
import sys
import math
import operator
import bisect
from collections import defaultdict
from io import BytesIO, IOBase
sys.setrecursionlimit(10 ** 5)

def inpt():
	return [int(k) for k in input().split()]

def main():
	for _ in range(int(input())):
		(a, b) = inpt()
		ans = 0
		dif = abs(a - b)
		for i in range(10, 0, -1):
			r = dif % i
			ans += dif // i
			dif = r
		print(ans)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


from sys import stdin, stdout
from math import ceil, floor, factorial, gcd, log, pi
from collections import deque, defaultdict, OrderedDict, Counter
import random
import itertools
from heapq import heapify, heappush, heappop
integerMaxValue = float('inf')
integerMinValue = float('-inf')
MOD = 10 ** 9 + 7

def readInt():
	return int(stdin.readline())

def readInts():
	return map(int, stdin.readline().strip().split())

def readString():
	return stdin.readline()

def readStrings():
	return map(str, stdin.readline().strip().split())

def readIntArray():
	return list(map(int, stdin.readline().strip().split()))

def readStrArray():
	return list(map(str, stdin.readline().strip().split()))

def constructMinHeap(nums, n):
	minHeap = []
	for num in nums:
		heappush(minHeap, num)
	return minHeap

def constructMaxHeap(nums, n):
	maxHeap = []
	for num in nums:
		heappush(maxHeap, -num)
	return maxHeap

def solve(a, b):
	if a > b:
		temp = a - b
	else:
		temp = b - a
	return ceil(temp / 10)
testCases = readInt()
for case in range(testCases):
	(a, b) = readInts()
	print(solve(a, b))


import sys
import math
import itertools

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

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

def input():
	return sys.stdin.readline().strip()
for _ in range(int(input())):
	(a, b) = get_ints()
	c = abs(a - b)
	if c % 10 == 0:
		print(c // 10)
	else:
		print(c // 10 + 1)


for t in range(int(input())):
	(n, m) = map(int, input().split())
	if n == m:
		print(0)
	else:
		x = abs(n - m)
		s = x // 10
		if x % 10 != 0:
			print(s + 1)
		else:
			print(s)


t = int(input())
for _ in range(t):
	(n, m) = map(int, input().split())
	p = abs(n - m)
	if p % 10 == 0:
		print(p // 10)
	else:
		print(p // 10 + 1)


n = int(input())
for i in range(n):
	(a, b) = map(int, input().split())
	ans = (abs(a - b) - 1) // 10 + 1
	print(ans)


import sys

def main():
	t = Iint()
	for _ in range(t):
		(a, b) = Imap()
		x = abs(a - b)
		print(x // 10 + bool(x % 10))
en = enumerate
FIO = 10
BUFSIZE = 8 * 1024

def Istr():
	return input()

def Iint():
	return int(input())

def Ilist():
	return list(map(int, input().split()))

def Imap():
	return map(int, input().split())

def Plist(li, s=' '):
	print(s.join(map(str, li)))

def debug(*args, c=6):
	pass
	print('\x1b[3{}m'.format(c), *args, '\x1b[0m', file=sys.stderr)
if not FIO:
	if __name__ == '__main__':
		main()
		exit()
else:
	from io import BytesIO, IOBase
	import os

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')
main()


t = int(input())
while t > 0:
	(n, k) = input().split()
	n = int(n)
	k = int(k)
	print(int(abs(k - n) / 10) + (abs(k - n) % 10 != 0))
	t -= 1


def main():
	t = int(input())
	for case in range(t):
		(a, b) = input().split()
		a = int(a)
		b = int(b)
		if a > b:
			(a, b) = swap(a, b)
		if a == b:
			print(0)
		else:
			count = 0
			count += (b - a) // 10
			rem = (b - a) % 10
			if rem > 0:
				count += 1
			print(count)

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)
main()


t = int(input())
lst = []
for i in range(t):
	(a, b) = map(int, input().split())
	lst.append([a, b])
for i in lst:
	x = abs(i[0] - i[1])
	print(int(x / 10)) if x % 10 == 0 else print(int(x // 10) + 1)


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	x = abs(a - b)
	f = (x + 9) // 10
	print(f)


t = int(input())
for i in range(t):
	count = 0
	(a, b) = map(int, input().split())
	diff = abs(a - b)
	while diff > 0:
		if diff >= 10:
			count = count + int(diff / 10)
			diff = diff % 10
			if diff == 0:
				break
		elif diff >= 9:
			count = count + int(diff / 9)
			diff = diff % 9
			if diff == 0:
				break
		elif diff >= 8:
			count = count + int(diff / 8)
			diff = diff % 8
			if diff == 0:
				break
		elif diff >= 7:
			count = count + int(diff / 7)
			diff = diff % 7
			if diff == 0:
				break
		elif diff >= 6:
			count = count + int(diff / 6)
			diff = diff % 6
			if diff == 0:
				break
		elif diff >= 5:
			count = count + int(diff / 5)
			diff = diff % 5
			if diff == 0:
				break
		elif diff >= 4:
			count = count + int(diff / 4)
			diff = diff % 4
			if diff == 0:
				break
		elif diff >= 3:
			count = count + int(diff / 3)
			diff = diff % 3
			if diff == 0:
				break
		elif diff >= 2:
			count = count + int(diff / 2)
			diff = diff % 2
			if diff == 0:
				break
		else:
			count = count + 1
			break
	print(count)


t = int(input())
while t > 0:
	t -= 1
	ans = 0
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	else:
		diff = abs(a - b)
		ans += diff // 10
		rem = diff % 10
		if rem > 0:
			ans += 1
		print(ans)


from math import ceil
for _ in range(int(input())):
	(x, y) = map(int, input().split())
	p = abs(x - y)
	ans = ceil(p / 10)
	print(int(ans))


def main():
	tmp = 0
	result_list = []
	n = int(input())
	for i in range(n):
		(a, b) = map(int, input().split())
		counter = 0
		flag = True
		c = a - b
		if c == 0:
			result_list.append(0)
			flag = False
		if a < b:
			tmp = a
			a = b
			b = tmp
		if a > b:
			while flag:
				if a - 10000000 > b:
					a -= 10000000
					counter += 1000000
				if a - 1000000 > b:
					a -= 1000000
					counter += 100000
				if a - 100000 > b:
					a -= 100000
					counter += 10000
				if a - 10000 > b:
					a -= 10000
					counter += 1000
				if a - 1000 > b:
					a -= 1000
					counter += 100
				if a - 100 > b:
					a -= 100
					counter += 10
				a -= 10
				counter += 1
				if a <= b:
					flag = False
					result_list.append(counter)
	for item in result_list:
		print(item)
main()


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	c = min(a, b)
	d = max(a, b)
	cd = abs(c - d)
	if cd / 10 == cd // 10:
		print(cd // 10)
	else:
		print(cd // 10 + 1)


from sys import stdin
input = lambda : stdin.readline().strip()
from math import ceil, sqrt, factorial, gcd
from collections import deque
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	t = abs(a - b)
	x = ceil(t / 10)
	print(x)


for i in range(int(input())):
	(a, b) = map(int, input().split())
	xx = max(a, b) - min(a, b)
	cnt = xx // 10
	if xx % 10 != 0:
		cnt += 1
	print(cnt)


import math
for i in range(int(input())):
	(a, b) = map(int, input().split())
	c = math.fabs(b - a)
	ans = math.ceil(c / 10)
	print(ans)


cases = int(input())
for i in range(cases):
	(a, b) = map(int, input().split())
	num = abs(b - a) // 10
	rem = abs(b - a) % 10
	if rem == 0:
		print(num)
	else:
		print(num + 1)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	x = abs(a - b)
	print(x // 10 + bool(x % 10))


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	diff = abs(a - b)
	ans = diff // 10 + (diff % 10 != 0)
	print(ans)


for i in range(int(input())):
	(a, b) = [int(s) for s in input().split()]
	print((abs(a - b) - 1) // 10 + 1)


T = int(input())
for case in range(T):
	(a, b) = map(int, input().split())
	ans = (abs(a - b) + 9) // 10
	print(ans)


for _ in range(int(input())):
	(x, y) = map(int, input().split())
	k = max(x, y) - min(x, y)
	b = k // 10
	a = k % 10
	if a == 0:
		print(b)
	else:
		print(1 + b)


p = int(input())
while p:
	(m, n) = [int(i) for i in input().split(' ')]
	if m > n:
		c = (m - n) // 10
		if (m - n) % 10 != 0:
			c = c + 1
		print(c)
	elif m < n:
		c = (n - m) // 10
		if (n - m) % 10 != 0:
			c = c + 1
		print(c)
	else:
		print('0')
	p = p - 1


t = int(input())
result = []
for i in range(t):
	(a, b) = map(int, input().split())
	if a == b:
		result.append(0)
	else:
		d = 0
		move = 0
		difference = abs(a - b)
		differenceString = str(difference)
		while len(differenceString) != 1:
			newDifference = differenceString[0] + '0' * (len(differenceString) - 1)
			newIntDifference = int(newDifference)
			d = newIntDifference / 10
			move += d
			difference -= newIntDifference
			differenceString = str(difference)
		if differenceString != '0':
			move += 1
			result.append(int(move))
		else:
			result.append(int(move))
for j in range(len(result)):
	print(result[j], end='\n')


t = int(input())
while t > 0:
	t -= 1
	line = input().split(' ')
	a = int(line[0])
	b = int(line[1])
	if a == b:
		print(0)
		continue
	diff = abs(a - b)
	if diff <= 10:
		print(1)
		continue
	if diff % 10 == 0:
		count = diff / 10
	else:
		count = diff / 10 + 1
	print(int(count))


def solve(a, b):
	s = 0
	n = abs(a - b)
	for i in range(10, 0, -1):
		s += n // i
		n = n % i
	return s
t = int(input())
for i in range(0, t):
	(a, b) = input().split()
	print(solve(int(a), int(b)))


x = int(input())
for i in range(x):
	(a, b) = map(int, input().split())
	s = 0
	z = abs(a - b)
	while z != 0:
		for i in range(10, 0, -1):
			s += z // i
			z -= z // i * i
	print(s)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	t = abs(a - b)
	p = t // 10
	q = t % 10
	if q:
		p += 1
	print(p)


from sys import stdin, stdout

def INPUT():
	return list((int(i) for i in stdin.readline().split()))

def inp():
	return stdin.readline()

def out(x):
	return stdout.write(x)
import math
import random
for _ in range(int(input())):
	(a, b) = INPUT()
	print(int(math.ceil(abs(a - b) / 10)))


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	diff = abs(a - b)
	res = diff // 10
	if diff % 10 > 0:
		res += 1
	print(res)


import sys
import math
mod = 998244353
cases = True
dynamic_factorial = False

def main(test_case=False):
	n = int(input()) if test_case else 1
	for _ in range(n):
		test()

def fast_pow(a: int, b: int):
	res = 1
	while b > 0:
		if b & 1:
			res *= a
		a *= a
		b >>= 1
	return res

def c2(n):
	return n * (n - 1) // 2

def get():
	return list(map(int, input().split()))

def bits(n: int):
	return list(bin(n)).count('1')

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

def parr(arr):
	print(*arr, sep=' ')

def gcd(a, b):
	while b:
		if b % a == 0:
			break
		tmp = a
		a = b % a
		b = tmp
	return a

def ext_gcd(a: int, b: int):
	if b == 0:
		return [a, [1, 0]]
	res = ext_gcd(b, a % b)
	g = res[0]
	if g != 1:
		return False
	x1 = res[1][0]
	y1 = res[1][1]
	x = y1
	y = x1 - y1 * (a // b)
	return [g, [x, y]]

def get_set(a):
	res = {}
	for x in a:
		if x in res:
			res[x] += 1
		else:
			res[x] = 1
	return res
fact = {0: 1}

def factorial(n):
	if dynamic_factorial:
		if n not in fact:
			fact[n] = factorial(n - 1) * n
		return fact[n]
	else:
		res = 1
		while n > 0:
			res = res * n % mod
			n -= 1
		return res

def sum_of(a):
	res = 0
	for x in a:
		res = (res + x) % mod
	return res

def prod_of(a):
	res = 1
	for x in a:
		res = res * x % mod
	return res

def test():
	(a, b) = get()
	print((max(a - b, b - a) + 9) // 10)
main(cases)


for x in range(int(input())):
	(val1, val2) = map(int, input().split())
	print(int(abs(val1 - val2) / 10) + min(1, abs(val1 - val2) % 10))


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	s = abs(b - a) // 10
	if abs(b - a) % 10 != 0:
		s += 1
	print(s)


from math import ceil
for _ in [*open(0)][1:]:
	(a, b) = map(int, _.split())
	print(ceil(abs(a - b) / 10))


def game():
	a = input()
	lists = []
	output_list = []
	for i in range(int(a)):
		a = input()
		l = [int(i) for i in a.split(' ')]
		lists.append(l)
	for i in lists:
		(a, b) = i
		dif = abs(b - a)
		tens = dif // 10
		if dif % 10:
			tens += 1
		output_list.append(str(tens))
	return '\n'.join(output_list)
print(game())


def main():
	t = int(input())
	for _ in range(t):
		(a, b) = map(int, input().split())
		d = abs(b - a)
		(q, r) = (d // 10, d % 10)
		print(q + (1 if r > 0 else 0))
main()


t = int(input())
for i in range(t):
	arr = input().split()
	a = int(arr[0])
	b = int(arr[1])
	if b < a:
		(a, b) = (b, a)
	ele = b - a
	ans = 0
	extra = ele % 10
	if extra != 0:
		ans += 1
	print(ans + ele // 10)


from math import ceil

def main():
	for i in range(int(input())):
		(a, b) = map(int, input().split())
		print(ceil((max(a, b) - min(a, b)) / 10))
main()


n = int(input())
for _ in range(n):
	(a, b) = map(int, input().split())
	k = abs(a - b)
	c = k % 10
	d = k // 10
	if c > 0:
		print(1 + d)
	else:
		print(d)


for _ in range(int(input())):
	(a, b) = (int(x) for x in input().split())
	if abs(a - b) % 10 == 0:
		print(abs(a - b) // 10)
	else:
		print(abs(a - b) // 10 + 1)


import math

def schet():
	string = input()
	(a, b) = list(map(int, string.split()))
	razn = a - b
	if razn == 0:
		print(0)
	else:
		razn = math.fabs(razn)
		if razn % 10 == 0:
			k = razn // 10
		else:
			k = razn // 10 + 1
		print(int(k))
t = int(input())
for i in range(t):
	schet()


t = int(input())
for test in range(t):
	(a, b) = map(int, input().split())
	(a, b) = (max(a, b), min(a, b))
	if a == b:
		print(0)
		continue
	print((a - b) // 10 + bool(a - ((a - b) // 10 * 10 + b)))


testCases = int(input(''))
for i in range(0, testCases):
	user = input('')
	data = user.split(' ')
	a = int(data[0])
	b = int(data[1])
	diff = abs(a - b)
	minSteps = int(diff / 10)
	if diff % 10 != 0:
		minSteps = minSteps + 1
	print(minSteps)


import sys
from functools import reduce
from collections import Counter
import time
import datetime
from math import sqrt, gcd

def ip():
	return int(sys.stdin.readline())

def sip():
	return sys.stdin.readline()

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

def mips():
	return map(str, sys.stdin.readline().split())

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

def matip(n, m):
	lst = []
	for i in range(n):
		arr = lip()
		lst.append(arr)
	return lst

def factors(n):
	return list(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def minJumps(arr, n):
	jumps = [0 for i in range(n)]
	if n == 0 or arr[0] == 0:
		return float('inf')
	jumps[0] = 0
	for i in range(1, n):
		jumps[i] = float('inf')
		for j in range(i):
			if i <= j + arr[j] and jumps[j] != float('inf'):
				jumps[i] = min(jumps[i], jumps[j] + 1)
				break
	return jumps[n - 1]

def dic(arr):
	return Counter(arr)

def check_prime(n):
	if n < 2:
		return False
	for i in range(2, int(n ** 0.5) + 1, 2):
		if n % i == 0:
			return False
	return True
n = ip()
while n:
	n -= 1
	(a, b) = mip()
	c = b - a
	ans = c // 10
	ans = abs(ans)
	if ans * 10 < c:
		ans += 1
	print(ans)


import math
Q = int(input())
for i in range(Q):
	(a, b) = map(int, input().split())
	I = b - a
	if I < 0 and I % 10 != 0:
		print(abs(math.ceil((b - a) / 10)) + 1)
	else:
		print(abs(math.ceil((b - a) / 10)))


t = int(input())
for i in range(t):
	(a, b) = list(map(int, input().split()))
	count = 0
	if a == b:
		print('0')
	elif a < b:
		count += (b - a) // 10
		if (b - a) % 10 != 0:
			count += 1
		print(count)
	elif a > b:
		count += (a - b) // 10
		if (a - b) % 10 != 0:
			count += 1
		print(count)


for i in range(int(input())):
	(a, b) = map(int, input().split())
	if a > b:
		(a, b) = (b, a)
	print(int((b - a) / 10) + (1 if (b - a) % 10 else 0))


def solve(a, b, count):
	if a > b:
		diff = a - b
	if a < b:
		diff = b - a
	if a == b:
		return count
	while diff != 0:
		while diff >= 10:
			count += diff // 10
			diff -= diff // 10 * 10
		while diff >= 9:
			diff -= 9
			count += 1
		while diff >= 8:
			diff -= 8
			count += 1
		while diff >= 7:
			diff -= 7
			count += 1
		while diff >= 6:
			diff -= 6
			count += 1
		while diff >= 5:
			diff -= 5
			count += 1
		while diff >= 4:
			diff -= 4
			count += 1
		while diff >= 3:
			diff -= 3
			count += 1
		while diff >= 2:
			diff -= 2
			count += 1
		while diff >= 1:
			diff -= 1
			count += 1
	return count
f = int(input())
for x in range(f):
	count = 0
	(a, b) = list(map(int, input().split()))
	print(solve(a, b, count))


import math
t = int(input())
for _ in range(t):
	(a, b) = list(map(int, input().split()))
	ans = math.ceil(abs(b - a) / 10)
	print(ans)


t = int(input())
while t:
	t -= 1
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	res = abs(a - b) // 10
	if abs(a - b) % 10 != 0:
		res += 1
	print(res)


t = int(input())
res = [0] * t
for k in range(t):
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	delta = abs(b - a)
	res[k] = delta // 10
	if res[k] * 10 < delta:
		res[k] += 1
for k in range(t):
	print(res[k])


import os
import sys
from io import BytesIO, IOBase
import math as M
import itertools as ITR
from collections import defaultdict as D
from collections import Counter as C
from collections import deque as Q
import threading
from functools import lru_cache, reduce
from functools import cmp_to_key as CMP
from bisect import bisect_left as BL
from bisect import bisect_right as BR
import random as R
import string
import cmath, time
enum = enumerate
start_time = time.time()
MOD = 1000000007
MA = float('inf')
MI = float('-inf')
di8 = [(1, 0), (1, 1), (0, 1), (-1, 1), (-1, 0), (-1, -1), (0, -1), (1, -1)]
di4 = [(1, 0), (0, 1), (-1, 0), (0, -1)]

def increase_stack():
	sys.setrecursionlimit(2 ** 32 // 2 - 1)
	threading.stack_size(1 << 27)
	t = threading.Thread(target=main)
	t.start()
	t.join()

def prints(a):
	print(a, end=' ')

def binary(n):
	return bin(n)[2:]

def decimal(s):
	return int(s, 2)

def pow2(n):
	p = 0
	while n > 1:
		n //= 2
		p += 1
	return p

def maxfactor(n):
	q = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			q.append(i)
	if q:
		return q[-1]

def factors(n):
	q = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			q.append(i)
			q.append(n // i)
	return list(sorted(list(set(q))))

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(M.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(i)
			n = n / i
	if n > 2:
		l.append(int(n))
	l.sort()
	return l

def isPrime(n):
	if n == 1:
		return False
	else:
		root = int(n ** 0.5)
		root += 1
		for i in range(2, root):
			if n % i == 0:
				return False
		return True

def seive(n):
	a = [1]
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p ** 2, n + 1, p):
				prime[i] = False
		p = p + 1
	for p in range(2, n + 1):
		if prime[p]:
			a.append(p)
	return a

def maxPrimeFactors(n):
	maxPrime = -1
	while n % 2 == 0:
		maxPrime = 2
		n >>= 1
	for i in range(3, int(M.sqrt(n)) + 1, 2):
		while n % i == 0:
			maxPrime = i
			n = n / i
	if n > 2:
		maxPrime = n
	return int(maxPrime)

def countchar(s, i):
	c = 0
	ch = s[i]
	for i in range(i, len(s)):
		if s[i] == ch:
			c += 1
		else:
			break
	return c

def str_counter(a):
	q = [0] * 26
	for i in range(len(a)):
		q[ord(a[i]) - 97] = q[ord(a[i]) - 97] + 1
	return q

def lis(arr):
	n = len(arr)
	lis = [1] * n
	maximum = 0
	for i in range(1, n):
		for j in range(0, i):
			if arr[i] > arr[j] and lis[i] < lis[j] + 1:
				lis[i] = lis[j] + 1
				maximum = max(maximum, lis[i])
	return maximum

def lcm(arr):
	a = arr[0]
	val = arr[0]
	for i in range(1, len(arr)):
		gcd = gcd(a, arr[i])
		a = arr[i]
		val *= arr[i]
	return val // gcd

def ncr(n, r):
	return M.factorial(n) // (M.factorial(n - r) * M.factorial(r))

def npr(n, r):
	return M.factorial(n) // M.factorial(n - r)

def inint():
	return int(inp())

def inarr():
	return list(map(int, inp().split()))

def invar():
	return map(int, inp().split())

def instr():
	s = inp()
	return list(s)

def insarr():
	return inp().split()
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
inp = lambda : sys.stdin.readline().rstrip('\r\n')
TestCases = 1

def solve():
	(a, b) = invar()
	c = abs(a - b)
	print(M.ceil(c / 10))

def main():
	flag = 0
	try:
		sys.stdin = open('c:/Users/Manoj Chowdary/Documents/python/CodeForces/contest-div-2/input.txt', 'r')
		sys.stdout = open('c:/Users/Manoj Chowdary/Documents/python/CodeForces/contest-div-2/output.txt', 'w')
	except:
		flag = 1
	t = 1
	if TestCases:
		t = inint()
	for _ in range(1, t + 1):
		solve()
	if not flag:
		print('Time: %.4f sec' % (time.time() - start_time))
		localtime = time.asctime(time.localtime(time.time()))
		print(localtime)
		sys.stdout.close()
main()


import sys
input = sys.stdin.readline
import heapq
import copy
import math
import decimal

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def insr2():
	s = input()
	return s[:len(s) - 1]

def invr():
	return map(int, input().split())
ans = 0

def pr_list(a):
	print(*a, sep=' ')

def main():
	tests = inp()
	mod = 1000000007
	limit = 10 ** 18
	ans = 0
	stack = []
	hashm = {}
	arr = []
	heapq.heapify(arr)
	for test in range(tests):
		[a, b] = inlt()
		diff = abs(b - a)
		ans = math.ceil(diff / 10)
		print(ans)
main()


import math
t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	if a % 10 == b % 10:
		print((max(a, b) - min(a, b)) // 10)
	else:
		print((max(a, b) - min(a, b)) // 10 + 1)


import math
t = int(input())
for case in range(t):
	(a, b) = [int(s) for s in input().split(' ')]
	answer = math.ceil(abs(b - a) / 10)
	print(answer)


import math
n = int(input())
a = list()
b = list()
answ = list()
m = 0
k = 0
for i in range(n):
	q = list(map(int, input().split(' ')))
	a.append(q[0])
	b.append(q[1])
for i in range(n):
	m = abs(a[i] - b[i])
	k = 0
	for j in range(10, 0, -1):
		k += m // j
		m -= m // j * j
	print(k)


m = int(input())
l = [list(map(int, input().split())) for i in range(m)]
for i in l:
	a = i[0]
	b = i[1]
	x = abs(a - b) / 10
	if x == int(x):
		print(int(x))
	else:
		print(int(x) + 1)


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	d = abs(a - b)
	print(int((d + 9) / 10))


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	elif b > a:
		rem = int((b - a) % 10)
		print((b - a) // 10 + (1 if rem != 0 else 0))
	else:
		rem = int((a - b) % 10)
		print((a - b) // 10 + (1 if rem != 0 else 0))


n = int(input())
for i in range(n):
	(a, b) = list(map(int, input().split()))
	s = abs(a - b)
	s1 = s // 10
	s2 = s % 10
	if s2 > 0:
		s1 += 1
	print(s1)


import math
t = int(input())
while t != 0:
	(a, b) = map(int, input().split())
	if a == b:
		print('0')
	elif a > b:
		a -= b
		print(math.ceil(a / 10))
	else:
		b -= a
		print(math.ceil(b / 10))
	t -= 1


import sys
from typing import List, Union

def rl(int_: bool=True, is_split: bool=True) -> Union[List[str], List[int]]:
	if int_:
		return [int(w) for w in sys.stdin.readline().split()]
	if is_split:
		return [w for w in sys.stdin.readline().split()]
	return sys.stdin.readline().strip()

def ops(x: int):
	m = 0
	while x:
		for i in range(10, 0, -1):
			m += x // i
			x = x % i
	return m
for _ in range(rl()[0]):
	(a, b) = rl()
	print(ops(abs(a - b)))


n = int(input())
for i in range(n):
	(a, b) = [int(j) for j in input().split()]
	(a, b) = sorted([a, b])
	if (b - a) % 10 == 0:
		print((b - a) // 10)
	else:
		print((b - a) // 10 + 1)


for i in range(int(input())):
	(a, b) = [int(x) for x in input().split()]
	if a % 10 == b % 10:
		print(abs(a - b) // 10)
	else:
		print(abs(a - b) // 10 + 1)


i = int(input())
for _ in range(i):
	(a, b) = map(int, input().split())
	if a > b:
		tmp = a
		a = b
		b = tmp
	tot = (b - a) // 10
	if (b - a) % 10 != 0:
		tot += 1
	print(tot)


from sys import stdin
_input = stdin.readline
(_range, _int, _abs) = (range, int, abs)

def solution():
	for _ in _range(_int(_input())):
		(a, b) = [_int(i) for i in _input().split()]
		d = _abs(b - a)
		print(d // 10 if d % 10 == 0 else d // 10 + 1)
solution()


n = int(input())
array_1 = []
array_2 = []
for i in range(0, n):
	numbers = input().split()
	array_1 += [int(numbers[0])]
	array_2 += [int(numbers[1])]
for i in range(0, n):
	k = abs(array_1[i] - array_2[i]) // 10
	if abs(array_1[i] - array_2[i]) % 10 != 0:
		k += 1
	print(k)


t = input()
for i in range(int(t)):
	line = input()
	line = line.split()
	a = line[0]
	b = line[1]
	diff = abs(int(a) - int(b))
	num = int(diff / 10)
	if not diff % 10 == 0:
		num = num + 1
	print(num)


t = int(input())
for i in range(t):
	(a, b) = input().split()
	(a, b) = (int(a), int(b))
	if a == b:
		c = 0
	elif (a - b) % 10 == 0:
		c = abs(a - b) // 10
	else:
		c = abs(a - b) // 10 + 1
	print(c)


test = int(input())
for t in range(test):
	(a, b) = map(int, input().split())
	minMove = 0
	differnce = 0
	if a != b:
		if a > b:
			c = a
			a = b
			b = c
		differnce = b - a
		while a != b:
			if differnce >= 10:
				steps = int((b - a) / 10)
				a += 10 * steps
				minMove += steps
				differnce = b - a
			else:
				a += differnce
				minMove += 1
	else:
		minMove = 0
	print(minMove)


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	diff = abs(a - b)
	if diff == 0:
		print(diff)
	else:
		c = diff // 10
		d = diff % 10
		if d != 0:
			e = 1
		else:
			e = 0
		move = abs(c + e)
		print(move)


for i in range(int(input())):
	(a, b) = input().split()
	dif = str(abs(int(a) - int(b)))
	if dif == '0':
		print(0)
	elif len(dif) == 1:
		print(1)
	elif dif[-1] == '0':
		print(dif[:-1])
	else:
		print(int(dif[:-1]) + 1)


n = int(input())
for i in range(n):
	l = input().split()
	a = abs(int(l[0]) - int(l[1]))
	if a % 10 == 0:
		print(a // 10)
	if a % 10 != 0:
		print(a // 10 + 1)


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
t = inp()
for _ in range(t):
	(m, n) = invr()
	k = abs(m - n)
	(k1, k2) = (k // 10, k % 10)
	if k2:
		k1 += 1
	print(k1)


t = int(input())
while t:
	(a, b) = map(int, input().split())
	x = abs(b - a)
	ans = x // 10
	if x % 10:
		ans = ans + 1
	print(ans)
	t = t - 1


import sys
input = sys.stdin.buffer.readline

def solution():
	(a, b) = map(int, input().split())
	x = abs(a - b)
	ans = 0
	ans += x // 10
	if x % 10:
		ans += 1
	print(ans)
t = int(input())
for _ in range(t):
	solution()


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	diff = abs(a - b)
	(c, d) = divmod(diff, 10)
	res = 0
	res += c
	res += 0 if d == 0 else 1
	print(res)


n = int(input())
for _ in range(n):
	(x, y) = map(int, input().split())
	c = abs(x - y)
	if c % 10 == 0:
		print(c // 10)
	else:
		print(c // 10 + 1)


import math
T = int(input())
for t in range(T):
	(a, b) = [int(i) for i in input().split(' ')]
	diff = abs(a - b)
	print(math.ceil(diff / 10))


import math
t = int(input())
for i in range(t):
	s = input().split()
	a = int(s[0])
	b = int(s[1])
	print(math.ceil(abs(a - b) / 10))


from sys import stdin
import math
for _ in range(int(stdin.readline())):
	(a, b) = list(map(int, stdin.readline().split()))
	res = math.ceil(abs(a - b) / 10)
	print(res)


def find(a, b):
	if a == b:
		return 0
	elif b > a:
		diff = b - a
		quo = diff // 10
		if quo * 10 == diff:
			return quo
		return quo + 1
	else:
		diff = a - b
		quo = diff // 10
		if quo * 10 == diff:
			return quo
		return quo + 1
t = int(input())
while t > 0:
	(a, b) = [int(ele) for ele in input().split()]
	print(find(a, b))
	t = t - 1


t = int(input())
while t > 0:
	t -= 1
	(a, b) = map(int, input().split())
	if a > b:
		(a, b) = (b, a)
	b = b - a
	c = 0
	if b == 0:
		print(0)
		continue
	else:
		k = 10
		while b > 0:
			c += b // k
			b = b % k
			k -= 1
		print(c)


from sys import stdin, stdout
input = stdin.readline
print = lambda x: stdout.write(str(x) + '\n')
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	t = abs(a - b)
	ans = t // 10 + (1 if t - t // 10 * 10 else 0)
	print(ans)


import math
t = int(input())
for i in range(t):
	(a, b) = list(map(int, input().split()))
	count = 0
	diff = abs(a - b)
	print(math.ceil(diff / 10))


z = int(input())
for i in range(z):
	lst = list(input().split())
	(lst[0], lst[1]) = (int(lst[0]), int(lst[1]))
	lst.sort()
	y = int((lst[1] - lst[0]) / 10)
	if (lst[1] - lst[0]) % 10 != 0:
		y += 1
	print(y)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	s = abs(a - b)
	if s == 0:
		print('0')
	else:
		print((s + 9) // 10)


def main():
	t = int(input())
	for _ in range(t):
		(a, b) = list(map(int, input().split()))
		p = abs(a - b) // 10 if abs(a - b) % 10 == 0 else abs(a - b) // 10 + 1
		print(p)
main()


n = int(input())
l = []
for i in range(n):
	(a, b) = [int(c) for c in input().split()]
	l.append((a, b))
for i in range(len(l)):
	(a, b) = l[i]
	if a == b:
		print(0)
		continue
	print(abs(a - b) // 10 + 1 if abs(a - b) % 10 != 0 else abs(a - b) // 10)


T = int(input())
for i in range(T):
	(A, B) = list(map(int, input().split()))
	K = A - B
	if K < 0:
		K = K * -1
	Answer = K // 10
	if K % 10 == 0:
		print(Answer)
	else:
		print(Answer + 1)


for i in range(int(input())):
	(a, b) = map(int, input().split())
	diff = abs(a - b)
	x = 1 if diff % 10 != 0 else 0
	print(diff // 10 + x)


import math
t = int(input())
moves = []
for tt in range(t):
	(a, b) = input().split()
	(a, b) = (int(a), int(b))
	if a == b:
		moves.append(0)
		continue
	elif a < b:
		moves.append(math.ceil((b - a) / 10))
		continue
	else:
		moves.append(math.ceil((a - b) / 10))
		continue
for i in moves:
	print(i)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	x = abs(b - a) // 10 + min(1, abs(b - a) % 10)
	print(x)


from math import ceil
k = range(1, 11)
for t in range(int(input())):
	(a, b) = map(int, input().split())
	print(ceil(abs(a - b) / 10))


import sys
sysinput = sys.stdin.readline
import time
start_time = time.time()

def inp():
	return int(sysinput())

def inlt():
	return list(map(int, sysinput().split()))

def insr():
	s = sysinput()
	return list(s[:len(s) - 1])

def invr():
	return map(int, sysinput().split())
t = inp()
while t > 0:
	t -= 1
	(a, b) = inlt()
	diff = abs(a - b)
	num = diff // 10
	if num * 10 != diff:
		num += 1
	print(num)


import math

def int_prob():
	t = int(input())
	for _ in range(t):
		li = list(map(int, input().split()))
		print(math.ceil((max(li) - min(li)) / 10))
int_prob()


try:

	def count(a, b):
		count = 0
		k = 10
		diff = a - b
		while diff:
			if diff >= k:
				count += diff // k
				diff = diff - k * (diff // k)
				k = 10
			else:
				k -= 1
		return count
	for i in range(int(input())):
		(a, b) = list(map(int, input().split()))
		if a > b:
			print(count(a, b))
		else:
			print(count(b, a))
except:
	pass


import math
n = int(input())
for i in range(n):
	numbers = input()
	tokens = numbers.split()
	count = 0
	for (a, b) in zip(tokens[::2], tokens[1::2]):
		a = int(a)
		b = int(b)
	d = abs(a - b)
	ans = d / 10.0
	print(math.ceil(ans))


import math
ans = []
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if a == b:
		x = 0
	else:
		x = math.ceil(abs((a - b) / 10))
	ans.append(x)
for x in ans:
	print(x)


def get_turn(a, b, k=10):
	t = 0
	while a != b:
		if abs(a - b) > k:
			div = abs(a - b) // k
			if a < b:
				a += k * div
			else:
				a -= k * div
			t += div
		else:
			a = b
			t += 1
	return t
number_of_sets = int(input())
for _ in range(number_of_sets):
	(a, b) = map(int, input().split(' '))
	print(get_turn(a, b))


def shakalakaBoomBoom(a, b):
	diff = abs(a - b)
	count = 0
	while diff != 0:
		rr = diff % 10
		if rr != 0:
			diff = diff - rr
			count += 1
		else:
			l = diff // 10
			diff = diff - l * 10
			count += l
	return count
t = int(input())
arr = []
for _ in range(t):
	(a, b) = map(int, input().split())
	x = shakalakaBoomBoom(a, b)
	arr.append(x)
for values in arr:
	print(values)


t = int(input())
out = []
for i in range(0, t):
	tmp = input().split(' ')
	a = int(tmp[0])
	b = int(tmp[1])
	out.append((abs(a - b) + 9) // 10)
print(*out, sep='\n')


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	diffrence = abs(a - b)
	move_1 = diffrence // 10
	moves = diffrence % 10
	if diffrence % 10 == 0:
		temp = 0
	else:
		temp = 1
	total = move_1 + temp
	print(total)


def main():
	outputs = []
	for __ in range(int(input())):
		(a, b) = list(map(int, input().split()))
		i = 10
		moves = 0
		while b != a and i >= 1:
			if a > b and a - b >= i:
				moves += (a - b) // i
				a -= (a - b) // i * i
			elif b > a and b - a >= i:
				moves += (b - a) // i
				a += (b - a) // i * i
			i -= 1
		outputs.append(moves)
	for output in outputs:
		print(output)
main()


import math

def moves_to_same(a, b):
	return math.ceil(abs(a - b) / 10)
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	print(moves_to_same(a, b))


import math
t = int(input())
while t:
	(a, b) = [int(x) for x in input().split()]
	c = abs(a - b)
	ans = math.ceil(c / 10)
	print(ans)
	t -= 1


from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf

def sp():
	return map(int, input().split())
t = int(input())
for _ in range(t):
	(a, b) = sp()
	print(ceil(abs(b - a) / 10))


from sys import stdin

def get_user_input():
	return list(map(int, stdin.readline().rstrip().split()))

def calculate(num):
	if num <= 0:
		return 0
	res = 1
	fact = 1
	temp_num = num // 10
	if num % 10 <= 0:
		res = 0
	while temp_num > 0:
		t = temp_num % 10
		temp_num = temp_num // 10
		res += fact * t
		fact *= 10
	return res
n = int(input())
output_list = []
for i in range(n):
	in_case = get_user_input()
	output_list.append(calculate(abs(in_case[0] - in_case[1])))
for out in output_list:
	print(out)


from math import ceil
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	print(ceil((max(a, b) - min(a, b)) / 10))


for i in range(int(input())):
	(a, b) = map(int, input().split())
	c = abs(b - a)
	if c == 0:
		print(0)
	elif c < 9:
		print(1)
	else:
		d = c // 10
		e = c % 10
		if e == 0:
			print(d)
		else:
			print(d + 1)


from sys import stdout
from sys import stdin

def get():
	return stdin.readline().strip()

def getf():
	return [int(i) for i in get().split()]

def put(a, end='\n'):
	stdout.write(str(a) + end)

def putf(a, sep=' ', end='\n'):
	stdout.write(sep.join(map(str, a)) + end)

def solve(a, b):
	return (b - a) // 10 + int((b - a) % 10 != 0)

def main():
	t = int(get())
	for i in range(t):
		(a, b) = getf()
		put(solve(min(a, b), max(a, b)))
main()


n = int(input())
for i in range(n):
	(a, b) = map(int, input().split(' '))
	if a > b:
		(a, b) = (b, a)
	print((b - a + 9) // 10)


import math
n = int(input())
for i in range(0, n):
	nums = input().split(' ')
	a = int(nums[0])
	b = int(nums[1])
	print(math.ceil(abs(a - b) / 10))


import sys
import math
from collections import Counter

def inputt():
	return sys.stdin.readline().strip()

def printt(n):
	sys.stdout.write(str(n) + '\n')

def listt():
	return [int(i) for i in inputt().split()]

def gcd(a, b):
	return math.gcd(a, b)

def lcm(a, b):
	return a * b / gcd(a, b)
t = int(inputt())
for _ in range(t):
	(a, b) = map(int, inputt().split())
	d = abs(b - a)
	count = 0
	while d != 0:
		if d >= 10:
			n = d // 10
			d = d % 10
			count += n
		else:
			d = 0
			count += 1
	printt(count)


def task_A():
	t = int(input())
	for _ in range(t):
		(a, b) = map(int, input().split())
		print(abs(a - b) // 10 + int(bool((a - b) % 10)))

def main():
	task_A()
main()


import math
t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	moves = 0
	diff = abs(a - b)
	moves += math.ceil(diff / 10)
	print(moves)


for _ in range(int(input())):
	(x, y) = map(int, input().split())
	count = 0
	temp = abs(x - y)
	count += temp // 10
	if temp % 10 > 0:
		print(count + 1)
	else:
		print(count)


import math
t = int(input())
for i in range(0, t):
	(x, y) = map(int, input().split())
	if x == y:
		print(0)
	else:
		ans = math.ceil(abs((x - y) / 10))
		print(ans)


for i in range(int(input())):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	else:
		h = abs(a - b)
		y = h // 10
		h -= y * 10
		if h > 0:
			y += 1
		print(y)


def solve(a, b):
	res = 0
	if a == b:
		return 0
	if a > b:
		if a - b <= 10:
			res = 1
		else:
			res = (a - b) // 10
			if (a - b) % 10 > 0:
				res += 1
		return res
	else:
		(a, b) = (b, a)
		if a - b <= 10:
			res = 1
		else:
			res = (a - b) // 10
			if (a - b) % 10 > 0:
				res += 1
		return res

def main():
	t = int(input())
	for _ in range(t):
		(a, b) = map(int, input().split())
		print(solve(a, b))
main()


testcases = int(input())
for testcase in range(testcases):
	temparr = input()
	temparr = temparr.split()
	a = int(temparr[0])
	b = int(temparr[1])
	lower = min(a, b)
	higher = max(a, b)
	diff = higher - lower
	if diff == 0:
		print(0)
		continue
	ans = diff // 10
	diff -= ans * 10
	if diff != 0:
		ans += 1
	print(ans)


for i in range(int(input())):
	count = 0
	(a, b) = map(int, input().split())
	d = abs(a - b)
	count = d // 10 if d % 10 == 0 else d // 10 + 1
	print(count)


import math
for i in range(int(input())):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	elif a > b:
		e = math.ceil((a - b) / 10)
		print(e)
	elif a < b:
		e = math.ceil((b - a) / 10)
		print(e)


for q in [*open(0)][1:]:
	(a, b) = map(int, q.split())
	print(0 - -abs(a - b) // 10)


def solve():
	T = int(input())
	ans = [0] * T
	for t in range(T):
		(a, b) = map(int, input().split())
		ans[t] = 0 - -abs(a - b) // 10
	return ans
print(*solve(), sep='\n')


def solve():
	(a, b) = map(int, input().split())
	x = abs(a - b)
	cnt = x // 10 + (x % 10 != 0)
	print(cnt)
t = int(input())
while t:
	solve()
	t -= 1


tc = int(input())
import math
for _ in range(tc):
	(a, b) = [int(x) for x in input().split()]
	ans = math.ceil(abs(a - b) / 10)
	print(ans)


import math

def find_number(a, b):
	moves = 0
	diff = math.fabs(a - b)
	moves = diff // 10
	moves = int(moves)
	if diff % 10 == 0:
		print(moves)
	else:
		print(moves + 1)
test_number = int(input())
cases = []
for i in range(test_number):
	(a, b) = input().split()
	cases.append([int(a), int(b)])
for pair in cases:
	find_number(pair[0], pair[1])


t = int(input())
for i in range(t):
	parts = input().split()
	diff = abs(int(parts[0]) - int(parts[1]))
	if diff % 10 == 0:
		print(diff // 10)
	else:
		print(diff // 10 + 1)


from collections import defaultdict as dd
from sys import stdin, stdout
from math import log
for t in range(int(input())):
	(a, b) = map(int, stdin.readline().strip().split())
	a = abs(a - b)
	if a % 10:
		stdout.write(str(a // 10 + 1) + '\n')
	else:
		stdout.write(str(a // 10) + '\n')


from math import ceil
T = int(input())
for i in range(T):
	(a, b) = (int(i) for i in input().split())
	print(ceil(abs(a - b) / 10))


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	elif b > a:
		ans = (b - a) // 10
		if (b - a) % 10 > 0:
			ans += 1
		print(ans)
	else:
		(a, b) = (max(a, b), min(a, b))
		ans = (a - b) // 10
		if (a - b) % 10 > 0:
			ans += 1
		print(ans)


def func(a, b):
	if a < b:
		(a, b) = (b, a)
	s = a - b
	if s % 10:
		print(s // 10 + 1)
	else:
		print(s // 10)
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	func(n, m)


import sys
import math

def main():
	pass

def binary(n):
	return bin(n).replace('0b', '')

def decimal(s):
	return int(s, 2)

def pow2(n):
	p = 0
	while n > 1:
		n //= 2
		p += 1
	return p

def isPrime(n):
	if n == 1:
		return False
	else:
		root = int(n ** 0.5)
		root += 1
		for i in range(2, root):
			if n % i == 0:
				return False
		return True

def sinp():
	return sys.stdin.readline().strip()

def iinp():
	return int(input())

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

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

def p(a):
	print(a)
for _ in range(iinp()):
	(a, b) = ninp()
	x = abs(a - b)
	if x % 10 == 0:
		print(x // 10)
	else:
		print(x // 10 + 1)


t = int(input())
for _ in range(t):
	(a, b) = list(map(int, input().rstrip().split()))
	if a > b:
		(a, b) = (b, a)
	m = (b - a) // 10
	if (b - a) % 10 != 0:
		m += 1
	print(m)


test = int(input())
for q in range(test):
	(a, b) = map(int, input().split())
	x = abs(a - b)
	if x % 10 == 0:
		print(x // 10)
	else:
		print(x // 10 + 1)


t = int(input())
while t > 0:
	(a, b) = map(int, input().split(' '))
	if a == b:
		print(0)
	else:
		if a < b:
			diff = b - a
		else:
			diff = a - b
		if diff <= 10:
			print(1)
		elif diff % 10 == 0:
			print(diff // 10)
		elif diff % 10 != 0:
			print(diff // 10 + 1)
	t -= 1


import math
m = int(input())
for i in range(m):
	n = input()
	for i in range(len(n)):
		if n[i] == ' ':
			d = [n[0:i] for x in range(0, i)]
			e = [n[i + 1:len(n)] for x in range(i + 1, len(n))]
			a = int(d[0])
			b = int(e[0])
	if a > b:
		c = a - b
	elif a < b:
		c = b - a
	elif a == b:
		c = -1
	change = c / 10
	change = math.ceil(change)
	print(change)


import math

def mayne():
	for _ in range(int(input())):
		(be, ah) = (int(x) for x in input().split())
		if ah < be:
			(ah, be) = (be, ah)
		sea = 0
		sea = math.ceil((ah - be) / 10)
		print(sea)
mayne()


test = int(input())
for _ in range(test):
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	x = abs(a - b)
	z = x // 10
	y = x % 10
	print(z + int(y > 0))


def number_of_moves(a, b):
	k = 0
	if a > b:
		k = a - b
	else:
		k = b - a
	if k % 10 == 0:
		return k // 10
	else:
		return k // 10 + 1
n = int(input())
a = []
b = []
for i in range(n):
	(c, d) = map(int, input().split())
	a.append(c)
	b.append(d)
for i in range(n):
	print(number_of_moves(a[i], b[i]))


t = int(input())
while t > 0:
	(a, b) = map(int, input().split())
	x = abs(b - a)
	ans = 0
	if x == 0:
		ans = 0
	elif x <= 10:
		ans += 1
	else:
		ans += x // 10
		if x % 10 != 0:
			ans += 1
	print(ans)
	t -= 1


t = int(input())
while t > 0:
	s = input().split()
	a = int(s[0])
	b = int(s[1])
	c = abs(b - a)
	e = int(c / 10)
	m = c % 10
	if m > 0:
		e += 1
	print(e)
	t -= 1


for _ in range(int(input())):
	(a, b) = [int(i) for i in input().split()]
	n_min = 0
	n = 0
	if a == b:
		n_min = 0
	else:
		n = abs(a - b) // 10
		if abs(a - b) % 10 != 0:
			n_min = n + 1
		else:
			n_min = n
	print(n_min)


import math
x = int(input())
for i in range(0, x):
	count = 0
	k = 0
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	while a != b:
		if a - b >= 10:
			k = math.floor((a - b) / 10)
			k = int(k)
			a = a - k * 10
			count = count + k
		elif a - b <= -10:
			k = math.floor((b - a) / 10)
			a = a + k * 10
			count = count + k
		elif a > b and abs(a - b) < 10:
			k = a - b
			a = a - k
			count += 1
		elif a < b and abs(a - b) < 10:
			k = b - a
			a = a + k
			count += 1
	if a == b:
		print(count)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	l = abs(a - b)
	count = 0
	if l % 10 != 0:
		count += 1
	l //= 10
	x = 1
	while l != 0:
		y = l % 10
		count += x * y
		l //= 10
		x *= 10
	print(count)


import math
t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	diff = abs(a - b)
	ans = diff // 10
	if diff % 10 != 0:
		ans += 1
	print(ans)


import math
for i in range(int(input())):
	(l, k) = map(int, input().split())
	mini = min(l, k)
	maxi = max(l, k)
	digits = [0] * 11
	if mini != maxi:
		while True:
			val = abs(maxi - mini)
			if val > 10:
				count = val / 10
				(fractional, whole) = math.modf(count)
				digits[10] += whole
				if fractional != 0:
					digits[int(fractional * 10)] += 1
				break
			else:
				digits[val] += 1
				break
	print(int(sum(digits)))


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	diff = abs(a - b)
	steps = diff // 10 + 1 * (diff % 10 != 0)
	print(steps)


t = int(input())
while t > 0:
	(a, b) = map(int, input().split())
	print((abs(a - b) + 9) // 10)
	t -= 1


for _ in range(int(input())):
	(a, b) = sorted(list(map(int, input().split())))
	d = b - a
	c = 0
	for i in range(10, 0, -1):
		c = d // i
		d = d - d // i
	print(c)


test_cases = int(input())
queries = []
for _ in range(test_cases):
	queries.append(list(map(int, input().rstrip().split())))
for individual in queries:
	a = individual[0]
	b = individual[1]
	if a == b:
		print(0)
	else:
		n1 = int(abs(b - a) / 10)
		if abs(b - a) % 10 == 0:
			print(n1)
		else:
			print(n1 + 1)


t = int(input())
for i in range(t):
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	if a == b:
		print('0')
	else:
		diff = abs(a - b)
		if a < b:
			temp = a
			a = b
			b = temp
		ct = 0
		i = 10
		while diff != 0 and i >= 1:
			if diff >= i:
				a = diff // i
				ct += a
				diff = diff - i * a
				i = i - 1
			else:
				i = i - 1
		print(ct)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	(c, d) = (max(a, b), min(a, b))
	x = (c - d) // 10
	if (c - d) % 10 == 0:
		print(x)
	else:
		print(x + 1)


t = int(input())
for x in range(t):
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	diff = abs(a - b)
	ans = diff / 10
	if diff % 10 != 0:
		ans += 1
	print(int(ans))


def findMoves(a, b):
	if a == b:
		return 0
	toCover = abs(a - b)
	if toCover % 10:
		extra = 1
	else:
		extra = 0
	return toCover // 10 + extra
t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	print(findMoves(a, b))


for _ in range(int(input())):
	(a, b) = list(map(int, input().split()))
	z = abs(b - a)
	if z == 0:
		print(0)
	elif z <= 10:
		print(1)
	else:
		zz = z // 10
		if z % 10 != 0:
			print(int(zz) + 1)
		else:
			print(int(zz))


import math

def solve(a, b):
	x = abs(a - b)
	return math.ceil(x / 10)
for i in range(int(input())):
	(a, b) = map(int, input().split())
	print(solve(a, b))


import math
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
		continue
	elif a > b:
		c = a - b
	elif a < b:
		c = b - a
	print(math.ceil(c / 10))


for t in range(int(input())):
	(a, b) = [int(x) for x in input().split()]
	if a > b:
		(a, b) = (b, a)
	diff = b - a
	count = diff // 10
	diff -= 10 * count
	count += 1 if diff != 0 else 0
	print(count)


testcases = int(input())
for i in range(testcases):
	(num1, num2) = [int(i) for i in input().split()]
	if num1 == num2:
		print('0')
	else:
		absolute = abs(num1 - num2)
		if absolute % 10 == 0:
			print(int(absolute / 10))
		else:
			print(int(absolute / 10) + 1)


import math
t = int(input())
ans = []
for i in range(t):
	(a, b) = [int(i) for i in input().split()]
	diff = max(a, b) - min(a, b)
	if diff == 0:
		ans.append(0)
	else:
		ans.append(math.ceil(diff / 10))
for i in ans:
	print(i)


t = int(input())
for i in range(t):
	(a, b) = input().split()
	(a, b) = (int(a), int(b))
	if a > b:
		d = a - b
	else:
		d = b - a
	print(int((d + 9) / 10))


q = int(input())
for d in range(q):
	(n, m) = map(int, input().split(' '))
	if n == m:
		print(0)
	elif n > m:
		temp = n - m
		if temp % 10 == 0:
			temp2 = temp // 10
			print(temp2)
		else:
			temp2 = temp // 10
			print(temp2 + 1)
	else:
		temp = m - n
		if temp % 10 == 0:
			temp2 = temp // 10
			print(temp2)
		else:
			temp2 = temp // 10
			print(temp2 + 1)


import sys
import collections as cc
I = lambda : list(map(int, input().split()))
for tc in range(int(input())):
	(a, b) = I()
	now = abs(b - a)
	ans = now // 10
	if now % 10:
		ans += 1
	print(ans)


for t in range(int(input())):
	(a, b) = map(int, input().split())
	if a > b:
		(a, b) = (b, a)
	out = 0
	b -= a
	out += b // 10
	if b % 10 != 0:
		out += 1
	print(out)


def min_moves(x, y):
	moves = 0
	if x - y == 0:
		return moves
	diff = abs(x - y)
	if diff % 10 == 0:
		moves = moves + diff // 10
	else:
		moves = moves + 1 + diff // 10
	return moves
t = int(input())
for i in range(t):
	num = input().split()
	a = int(num[0])
	b = int(num[1])
	result = min_moves(a, b)
	print(result)


for _ in range(int(input())):
	(n, k) = map(int, input().rstrip().split())
	c = abs(n - k)
	if c % 10 == 0:
		print(c // 10)
	else:
		print(c // 10 + 1)


def answer(a, b):
	x = abs(a - b)
	k = x % 10
	if k > 0:
		return x // 10 + 1
	else:
		return x // 10
t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	print(answer(a, b))


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	c = abs(a - b)
	print(c // 10 + bool(c % 10))


import sys
t = int(input())
for i in range(t):
	c = 0
	args = input().split()
	a = int(args[0])
	b = int(args[1])
	if a == b:
		print(0)
		continue
	if b > a:
		(b, a) = (a, b)
	c = int((a - b) / 10)
	print(c + 1 if (a - b) % 10 != 0 else c)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	print(-(-abs(a - b) // 10))


x = int(input())
import math
for i in range(x):
	(a, b) = map(int, input().split())
	y = abs(a - b)
	if y % 10 == 0:
		print(int(y / 10))
	else:
		print(math.ceil(y / 10))


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	c = 0
	if a < b:
		if (b - a) % 10 == 0:
			c += -1
		c += (b - a) // 10 + 1
	elif a > b:
		if (a - b) % 10 == 0:
			c += -1
		c += (a - b) // 10 + 1
	print(c)


ar = []
for i in range(int(input())):
	(a, b) = [int(x) for x in input().split()]
	ar.append((abs(a - b) + 9) / 10)
for ans in ar:
	print(int(ans))


import math

def ii():
	return int(input())

def si():
	return input()

def li():
	return list(map(int, input().split()))

def mi():
	return map(int, input().split())

def dpc(a, b):
	return [[0] * b for i in range(a)]

def solve():
	(a, b) = mi()
	if a == b:
		print(0)
	elif abs(a - b) % 10 == 0:
		print(abs(a - b) // 10)
	else:
		print(abs(a - b) // 10 + 1)
t = ii()
for _ in range(t):
	solve()


def ans():
	N = int(input())
	for i in range(N):
		anss = 0
		c = input().split()
		a = int(c[0])
		b = int(c[1])
		if (a - b) % 10 != 0:
			anss = abs(a - b) // 10 + 1
		else:
			anss = abs(a - b) // 10
		print(anss)
ans()


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	diff = a - b if a > b else b - a
	mod = 1 if diff % 10 > 0 else 0
	ans = diff // 10 + mod
	print(ans)


for j in range(int(input())):
	l = list(map(int, input().split()))
	subs = abs(l[0] - l[1])
	ans = 0
	for i in range(10, 0, -1):
		div = subs // i
		if div > 0:
			ans += div
			subs = subs % i
			if subs == 0:
				break
	print(ans)


def ans(a, b):
	if a == b:
		return '0'
	res = 0
	res = (a - b) // 10
	if (a - b) % 10 == 0:
		return res
	return res + 1
t = int(input())
for i in range(t):
	(a, b) = input().split(' ')
	a = int(a)
	b = int(b)
	if a < b:
		(a, b) = (b, a)
	print(ans(a, b))


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	d = abs(a - b)
	r = d // 10
	if d % 10 > 0:
		r += 1
	print(r)


n = int(input())
l = list()
for _ in range(n):
	ans = 0
	(a, b) = [int(i) for i in input().split()]
	if a != b:
		t = abs(a - b) % 10 == 0
		if t:
			ans = abs(a - b) // 10
		else:
			ans = abs(a - b) // 10 + 1
	l.append(ans)
for t in l:
	print(t)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	c = a - b if a >= b else b - a
	print((c + 9) // 10, flush=True)


import math
for i in range(int(input())):
	(a, b) = [*map(int, input().split())]
	if a == b:
		print('0')
	else:
		print(math.ceil(math.fabs(b - a) / 10))


for I in range(int(input())):
	(a, b) = map(int, input().split())
	diff = abs(a - b)
	temp = diff // 10
	if diff % 10 == 0:
		print(temp)
	else:
		print(temp + 1)


for t in range(int(input())):
	(a, b) = map(int, input().split())
	diff = abs(b - a)
	res = diff // 10
	overflow = diff % 10
	if overflow != 0:
		flag = 1
	else:
		flag = 0
	final = res + flag
	print(final)


for _ in range(int(input())):
	(a, b) = list(map(int, input().split()))
	count = 0
	diff = b - a
	diff = -diff if diff < 0 else diff
	count = diff // 10
	count += 1 if diff % 10 else 0
	print(count)


import math

class Read:

	@staticmethod
	def string():
		return input()

	@staticmethod
	def int():
		return int(input())

	@staticmethod
	def list(sep=' '):
		return input().split(sep)

	@staticmethod
	def list_int(sep=' '):
		return list(map(int, input().split(sep)))

def solve():
	(a, b) = Read.list_int()
	v = abs(a - b)
	print(math.ceil(v / 10))
query_count = Read.int()
while query_count:
	query_count -= 1
	solve()


import math

def func(n):
	for _ in range(n):
		(a, b) = map(int, input().split())
		if abs(a - b) == 0:
			k.append('0')
		elif abs(a - b) > 0:
			k.append(str(math.ceil(abs(a - b) / 10)))
	print('\n'.join(k))
k = []
func(int(input()))


import sys, os.path
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
sys.setrecursionlimit(10 ** 5)

def ii():
	return int(sys.stdin.readline())

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

def li():
	return list(map(int, sys.stdin.readline().split()))
print = sys.stdout.write

def solve():
	(a, b) = mi()
	r = abs(a - b)
	c = r % 10
	d = r // 10
	if c == 0:
		print(str(d) + '\n')
	else:
		print(str(d + 1) + '\n')
for _ in range(ii()):
	solve()


t = int(input())
while t > 0:
	(a, b) = [int(i) for i in input().split()]
	if a == b:
		print(0)
	elif b > a:
		x = b - a
		if x % 10 != 0:
			c = x // 10 + 1
			print(c)
		else:
			c = x // 10
			print(c)
	elif a > b:
		x = a - b
		if x % 10 != 0:
			c = x // 10 + 1
			print(c)
		else:
			c = x // 10
			print(c)
	t = t - 1


from sys import stdin
input = lambda : stdin.readline().strip()
for _ in range(int(input())):
	(a, b) = list(map(int, input().split()))
	c = abs(a - b)
	nd = c // 10
	if c % 10 != 0:
		nd += 1
	print(nd)


from math import ceil
for t in range(int(input())):
	(a, b) = (int(x) for x in input().split())
	print(ceil(abs(b - a) / 10))


(n, l) = (int(input()), [])
for i in range(n):
	l.append([int(k) for k in input().split()])
	l[-1].sort()
for i in l:
	h = int((i[1] - i[0]) / 10)
	if i[1] - h * 10 == i[0]:
		print(h)
	else:
		print(h + 1)


import math
for _ in range(int(input())):
	(a, b) = list(map(int, input().split()))
	if a == b:
		print(0)
	else:
		c = abs(a - b)
		print(math.ceil(c / 10))


n = int(input())
t = [input() for i in range(n)]
for i in t:
	(a, b) = i.split()
	subs = abs(int(a) - int(b))
	if subs % 10 == 0:
		print(subs // 10)
	else:
		print(subs // 10 + 1)


def call(a, b):
	req = b - a
	req = abs(req)
	moves = [10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
	ans = req
	sumo = 0
	for i in range(10):
		curr = moves[i]
		sumo += ans // curr
		ans = ans % curr
	print(sumo)
t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	call(a, b)


from sys import stdin, stdout
q = int(input())
for i in range(q):
	(a, b) = list(map(int, stdin.readline().split()))
	d = abs(a - b)
	if d == 0:
		print(0)
	elif d <= 10:
		print(1)
	else:
		f = d % 10
		e = d // 10
		if f == 0:
			print(f + e)
		else:
			print(e + 1)


import math
for i in range(int(input())):
	(a, b) = input().split()
	temp = abs(int(b) - int(a))
	ans = math.ceil(temp / 10)
	print(ans)


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	else:
		diff = abs(a - b)
		print((diff + 9) // 10)


l = []
a = []
t = int(input())
for i in range(t):
	l = [int(x) for x in input().split()]
	if len(l) == 2:
		d = abs(l[0] - l[1])
		if d % 10 != 0:
			r = d // 10 + 1
		else:
			r = d // 10
		a.append(r)
for r in a:
	print(r)


n = int(input())
for _ in range(n):
	(m, l) = map(int, input().split())
	if abs(m - l) % 10 == 0:
		print(abs(m - l) // 10)
	elif m != l:
		print(abs(m - l) // 10 + 1)
	else:
		print('0')


def integers(a, b):
	value = abs(a - b)
	d = value // 10
	r = value % 10
	if r != 0:
		d += 1
	return d
t = int(input())
for i in range(t):
	(a, b) = tuple(map(int, input().split()))
	print(integers(a, b))


n = int(input())
list2 = []
for i in range(0, n):
	list1 = list(map(int, input().split()))
	list2.append(list1)
for i in list2:
	a = i[0]
	b = i[1]
	diff = abs(a - b)
	q = diff // 10
	rem = diff % 10
	if rem == 0:
		count = q
	else:
		count = q + 1
	print(count)


n = int(input())
for i in range(n):
	arr = list(map(int, input().split()))
	sum = 0
	if arr[0] == arr[1]:
		print(sum)
	elif arr[0] > arr[1]:
		x = arr[0] - arr[1]
		if x % 10 == 0:
			sum = int(x / 10)
		else:
			sum = int(x / 10) + 1
		print(sum)
	else:
		x = arr[1] - arr[0]
		if x % 10 == 0:
			sum = int(x / 10)
		else:
			sum = int(x / 10) + 1
		print(sum)


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split(' '))
	if a == b:
		print(0)
		continue
	else:
		num = abs(b - a) // 10
		mod = abs(b - a) % 10
		if mod == 0:
			print(num)
		else:
			print(num + 1)


import math
t = int(input())

def olimp(a, b):
	if b - a < 0:
		return int(math.fabs(math.floor((b - a) / 10)))
	return math.ceil((b - a) / 10)
for i in range(t):
	z = input().split()
	print(olimp(int(z[0]), int(z[1])))


import math

def res(a, b):
	ans = abs(b - a)
	print(math.ceil(ans / 10))
t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	res(a, b)


n = int(input())
for i in range(n):
	list1 = input().split(' ')
	count = 0
	x = 0
	x1 = 0
	x2 = 0
	(a, b) = (int(list1[0]), int(list1[1]))
	if a == b:
		print('0')
		continue
	if a != b:
		x = b - a
		x1 = abs(x) // 10
		count += abs(x1)
		if x % 10 > 0:
			count += 1
	print(count)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	z = abs(a - b)
	print(z // 10 + int(z % 10 != 0))


import sys
import math
inputs = []
res = []
userIn = int(input())
for i in range(0, userIn):
	(a, b) = input().split()
	x = [a, b]
	inputs.append(x)
for i in range(0, userIn):
	a = int(inputs[i][0])
	b = int(inputs[i][1])
	counter = 0
	multOfTen = abs(math.floor((a - b) / 10))
	if a == b:
		res.append(0)
	elif a < b:
		a += multOfTen * 10
		counter += multOfTen
		p = 9
		while a < b:
			if a + p <= b:
				a += p
				counter += 1
			elif a + p > b:
				p -= 1
		res.append(counter)
	elif a > b:
		a -= multOfTen * 10
		counter += multOfTen
		p = 9
		while a > b:
			if a - p >= b:
				a -= p
				counter += 1
			elif a - p < b:
				p -= 1
		res.append(counter)
for i in range(0, len(res)):
	print(res[i])


t = int(input())
while t:
	t -= 1
	lst = list(map(int, input().split()))
	a = abs(lst[0] - lst[1])
	if a % 10:
		print(a // 10 + 1)
	else:
		print(a // 10)


class Min_tem:

	def __init__(self, a, b):
		self.first = a
		self.second = b

	def compute(self):
		diff = abs(self.second - self.first)
		if diff == 0:
			return 0
		else:
			if diff % 10 == 0:
				return diff // 10
			return diff // 10 + 1
t = int(input())
for i in range(t):
	ls = [int(x) for x in input().split()]
	res = Min_tem(ls[0], ls[1])
	print(res.compute())


t = int(input())
for i in range(t):
	(x, y) = list(map(int, input().split()))
	solo = abs(x - y)
	if solo % 10 != 0:
		print(solo // 10 + 1)
	else:
		print(solo // 10)


import sys
from math import ceil
t = [int(val) for val in sys.stdin.readline().split()][0]
for test in range(t):
	(a, b) = [int(val) for val in sys.stdin.readline().split()]
	diff = abs(a - b)
	print(ceil(diff / 10.0))


for iii in range(int(input())):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	elif a > b:
		x = a - b
		if x % 10 == 0:
			print(x // 10)
		else:
			print(x // 10 + 1)
	else:
		x = b - a
		if x % 10 == 0:
			print(x // 10)
		else:
			print(x // 10 + 1)


import math
t = int(input())
while t > 0:
	t -= 1
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	else:
		dif = abs(b - a)
		ans = math.ceil(dif / 10)
		print(ans)


t = int(input())
while t:
	(a, b) = map(int, input().strip().split())
	diff = abs(a - b)
	if diff % 10 != 0:
		print(diff // 10 + 1)
	else:
		print(diff // 10)
	t = t - 1


a = int(input())
i = 0
while i < a:
	b = input().split(' ')
	c = int(b[0])
	d = int(b[1])
	c = abs(c - d)
	if c % 10 == 0:
		print(c // 10)
	else:
		print(c // 10 + 1)
	i = i + 1


def findMin(V):
	if V % 10 == 0:
		ans = int(V / 10)
	else:
		ans = int(V / 10) + 1
	print(ans)
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	findMin(abs(a - b))


t = int(input())
s = []
for i in range(t):
	(a, b) = map(int, input().split(' '))
	q = abs(a - b)
	w = q // 10
	if q % 10 != 0:
		s.append(w + 1)
	else:
		s.append(w)
for i in s:
	print(i)


import math

def read_ints():
	return map(int, input().split())
t = int(input())
for i in range(t):
	a = []
	a = list(read_ints())
	dif = abs(a[0] - a[1])
	ans = math.ceil(dif / 10)
	print(ans)


import math
t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	elif a > b:
		if (a - b) % 10 != 0:
			print(math.ceil((a - b) / 10))
		else:
			print(math.floor((a - b) / 10))
	elif (b - a) % 10 != 0:
		print(math.ceil((b - a) / 10))
	else:
		print(math.floor((b - a) / 10))


t = int(input())
for _ in range(t):
	(a, b) = list(map(int, input().split(' ')))
	diff = abs(b - a)
	if diff == 0:
		print(0)
		continue
	r = diff // 10
	m = 1 if diff % 10 != 0 else 0
	print(r + m)


import math
import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
t = int(input())
for i in range(t):
	(a, b) = list(map(int, input().split()))
	c = abs(a - b)
	print(math.ceil(c / 10))


i = int(input())
for k in range(i):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
		continue
	dif = abs(a - b)
	steps = 0
	steps += int(dif / 10)
	if dif % 10:
		steps += 1
	print(steps)


for _ in range(int(input())):
	(num, conv_num) = map(int, input().split())
	x = abs(conv_num - num)
	y = x // 10
	if x % 10 != 0:
		print(y + 1)
	else:
		print(y)


for _ in range(int(input())):
	(x, y) = map(int, input().split())
	if x == y:
		print(0)
	else:
		out = abs(x - y)
		counter = out // 10
		if out % 10 != 0:
			counter += 1
		print(counter)


t = int(input())
while t > 0:
	(x, y) = list(map(int, input().split()))
	c = 0
	d = abs(y - x)
	if d % 10:
		c = d // 10 + 1
	else:
		c = int(d / 10)
	print(c)
	t -= 1


for _ in range(int(input())):
	lst = list(map(int, input().split()))
	(a, b) = (lst[0], lst[1])
	answer = 0 - -abs(a - b) // 10
	print(answer)


def abs_val(n):
	return n if n >= 0 else -n

def solve():
	(a, b) = map(int, input().split())
	v = abs_val(b - a)
	c = v // 10 + (1 if v % 10 != 0 else 0)
	print(c)
for _ in range(int(input())):
	solve()


import sys, io, os, time
from collections import defaultdict
from collections import Counter
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect, math, heapq
alphabet = 'abcdefghijklmnopqrstuvwxyz'
input = sys.stdin.readline
for ii in range(int(input())):
	(a, b) = map(int, input().split())
	diff = abs(b - a)
	print(math.ceil(diff / 10))


from sys import stdin
import math
t = int(stdin.readline().strip())
for i in range(t):
	l = list(map(int, stdin.readline().strip().split(' ')))
	a = l[0]
	b = l[1]
	if a > b:
		print(math.ceil((a - b) / 10))
	else:
		print(math.ceil((b - a) / 10))


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	(d, r) = divmod(abs(a - b), 10)
	print(d + bool(r))


t = int(input())
for q in range(t):
	(a, b) = list(map(int, input().split()))
	if a == b:
		ans = 0
	else:
		ans = abs(a - b) // 10
		if abs(a - b) % 10 == 0:
			pass
		else:
			ans = ans + 1
	print(ans)


def f(x):
	if x - int(x) > 0:
		return int(x) + 1
	return x
for _ in range(int(input())):
	(x, y) = map(int, input().split())
	print(int(f(abs(x - y) / 10)))


t = int(input())
for test in range(t):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	elif b > a:
		diff = b - a
		res = diff // 10
		res1 = diff % 10
		if res1 != 0:
			res = res + 1
		print(res)
	else:
		diff = a - b
		res = diff // 10
		res1 = diff % 10
		if res1 != 0:
			res = res + 1
		print(res)


from collections import defaultdict
from collections import Counter
from sys import setrecursionlimit as srl
srl(2 * 10 ** 6)

def solve(a, b):
	diff = abs(b - a)
	moves = 0
	moves += diff // 10
	rem = diff % 10
	if rem:
		moves += 1
	return moves
t = int(input())
while t:
	(n, m) = map(int, input().split())
	print(solve(n, m))
	t -= 1


for i in range(int(input())):
	(a, b) = input().split()
	n = abs(int(a) - int(b))
	c = n // 10
	if n % 10 != 0:
		c += 1
	print(c)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	d = abs(a - b) + 9
	print(d // 10)


for _ in range(int(input())):
	(a, b) = sorted([int(j) for j in input().split()])
	diff = b - a
	count = int(diff / 10)
	if diff % 10 != 0:
		count += 1
	print(count)


t = int(input())
l = []
for _ in range(t):
	l.append([int(i) for i in input().split()])

def check(a, b):
	if a == b:
		return 0
	if a < b:
		r = (b - a) % 10
		if r != 0:
			return (b - a) // 10 + 1
		else:
			return (b - a) // 10
	else:
		r = (a - b) % 10
		if r != 0:
			return (a - b) // 10 + 1
		else:
			return (a - b) // 10
for i in range(t):
	print(check(l[i][0], l[i][1]))


t = int(input())
list = []
for i in range(t):
	out = 0
	(a, b) = [int(x) for x in input().split()]
	out += abs(a - b) // 10
	if (a - b) % 10 != 0:
		out += 1
	list.append(out)
for elem in list:
	print(elem)


number = int(input())
result = []

def good(a, b):
	if (a - b) % 10 == 0:
		return int(abs(a - b) / 10)
	else:
		return int(abs(a - b) / 10) + 1
for i in range(number):
	line = input()
	(first, second) = line.split()
	first = int(first)
	second = int(second)
	result.append(good(first, second))
for i in range(number):
	print(result[i])


import math

def main():
	t = int(input())
	for _ in range(t):
		(a, b) = [int(x) for x in input().split()]
		print(math.ceil(abs(b - a) / 10))
main()


import sys
t = int(sys.stdin.readline())
for i in range(t):
	(a, b) = map(int, sys.stdin.readline().split())
	diff = abs(a - b)
	c = 0
	for i in range(10, 0, -1):
		c += diff // i
		diff %= i
		if diff == 0:
			break
	sys.stdout.write(str(c) + '\n')


def getAns(a, b):
	return (abs(a - b) + 9) // 10

def main():
	t = int(input())
	anss = [0] * t
	for i in range(t):
		(a, b) = map(int, input().split())
		anss[i] = getAns(a, b)
	for ans in anss:
		print(ans)
main()


T = int(input())
for t in range(1, T + 1):
	string = input().split()
	a = int(string[0])
	b = int(string[1])
	answer = abs(b - a) // 10
	if answer * 10 < abs(b - a):
		answer += 1
	print(answer)


for i in range(int(input())):
	(a, b) = list(map(int, input().split()))
	r = 0
	if abs(b - a) > 10:
		r = abs(b - a)
		if r % 10 == 0:
			print(r // 10)
		else:
			print(r // 10 + 1)
	elif abs(b - a) <= 10 and abs(b - a) > 0:
		print(1)
	else:
		print(0)


from sys import stdin, stdout
import math
for t in range(int(stdin.readline())):
	(a, b) = map(int, stdin.readline().split())
	ans = math.ceil(abs(a - b) / 10)
	print(ans)


import sys
from sys import setrecursionlimit
from collections import defaultdict
setrecursionlimit(10 ** 5)
readline = sys.stdin.readline

def process():
	(a, b) = map(int, readline().strip().split())
	if a == b:
		print(0)
		return
	diff = a - b if a > b else b - a
	if diff % 10 == 0:
		print(diff // 10)
		return
	print(1 + diff // 10)
for _ in range(int(readline())):
	process()


t = int(input())
for i in range(t):
	ip = input().split(' ')
	a = int(ip[0])
	b = int(ip[1])
	diff = abs(a - b)
	if diff % 10 == 0:
		print(int(diff / 10))
	else:
		print(int(diff // 10) + 1)


for _ in range(int(input())):
	(m, n) = map(int, input().split())
	if (max(m, n) - min(m, n)) % 10 == 0:
		print((max(m, n) - min(m, n)) // 10)
	else:
		print((max(m, n) - min(m, n)) // 10 + 1)


import math

def number_of_moves(a, b):
	diff = abs(a - b)
	return math.ceil(diff / 10)
no_lines = int(input())
for i in range(no_lines):
	line = input()
	(a, b) = line.split(' ')
	(a, b) = (int(a), int(b))
	print(number_of_moves(a, b))


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	m = abs(b - a)
	ans = m // 10
	if m % 10 == 0:
		print(ans)
	else:
		print(ans + 1)


def ad(d, a):
	if d > 10:
		a = a + 10
	else:
		a = a + d
	return a

def sub(d, a):
	if d > 10:
		a = a - 10
	else:
		a = a - d
	return a

def reduce_diff_lessthanten(a, b):
	d = a - b
	if d > 0:
		m = d // 10
		a = a - m * 10
	else:
		m = abs(d) // 10
		a = a + m * 10
	return [a, m]
t = int(input())
for i in range(t):
	(a, b) = [int(x) for x in input().split()]
	m = 0
	(a, m) = reduce_diff_lessthanten(a, b)
	d = a - b
	while not d == 0:
		if d > 0:
			a = sub(abs(d), a)
			m = m + 1
		else:
			a = ad(abs(d), a)
			m = m + 1
		d = a - b
	print(m)


from fractions import Fraction
from collections import defaultdict
import math
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')
t = int(input())
for _ in range(t):
	(a, b) = [int(x) for x in input().split()]
	c = abs(b - a)
	t = 0
	if c % 10 != 0:
		t = 1
	print(c // 10 + t)


t = int(input())
for case in range(t):
	(a, b) = list(map(int, input().split()))
	diff = abs(a - b)
	ten = diff // 10 + int(diff % 10 > 0)
	print(ten)


import math
t = int(input())
i = 0
while i < t:
	ab = list(map(int, input().split()))
	a = ab[0]
	b = ab[1]
	answer = 0
	z = math.ceil(abs(a - b) / 10)
	print(z)
	i += 1


for t in range(int(input())):
	(a, b) = map(int, input().split())
	(a, b) = (max(a, b), min(a, b))
	s = a - b
	ans = 0
	if s % 10:
		ans = 1
	ans += s // 10
	print(ans)


t = int(input())
for i in range(t):
	lst = list(map(int, input().split()))
	t = abs(lst[0] - lst[1])
	if t % 10 != 0:
		print(int(t / 10) + 1)
	else:
		print(int(t / 10))


def twoint(a, b):
	c = abs(a - b)
	co = int(c / 10)
	if c % 10 != 0:
		co = co + 1
	return co
t = int(input(''))
l = []
for i in range(t):
	nk = input('')
	(n, k) = map(int, nk.split())
	c = twoint(n, k)
	l.append(c)
for c in l:
	print(c)


for _ in range(int(input())):
	(x, y) = [int(x) for x in input().split()]
	print(int((abs(x - y) + 9) / 10))


def solve(a, b):
	if a == b:
		return 0
	c = abs(a - b)
	if c % 10 == 0:
		ans = c // 10
	else:
		ans = 1 + c // 10
	return ans
t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	print(solve(a, b))


import sys
pprint = lambda s: print(' '.join(map(lambda x: str(x), s)))
input = lambda : sys.stdin.readline().strip()
ipnut = input
mod = 1000000007
for i in range(int(input())):
	(a, b) = map(int, input().split())
	d = abs(a - b)
	print((d + 9) // 10)


def inp_n():
	return int(input())

def inp_list():
	return list(map(int, input().split()))

def inp_mul_num():
	return map(int, input().split())

def is_odd(n):
	if n & 1:
		return True
	return False

def is_prime(n):
	i = 2
	while i * i <= n:
		if n % i == 0:
			return False
		i += 1
	return True
from collections import defaultdict
import math
for _ in range(inp_n()):
	(a, b) = inp_mul_num()
	diff = abs(a - b)
	m = 0
	if diff % 10 == 0:
		m = diff // 10
	else:
		m = diff // 10 + 1
	print(m)


import math
for _ in range(int(input())):
	(x, y) = input().split()
	print(math.ceil(abs(int(x) - int(y)) / 10))


def solution(a, b):
	return abs(a - b) // 10 + bool(abs(a - b) % 10)
t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split(' '))
	print(solution(a, b))


t = int(input())
(a, b) = (0, 0)
for i in range(t):
	(a, b) = map(int, input().split())
	(a, b) = (min(a, b), max(a, b))
	number = 10
	count = 0
	difference = b - a
	while difference != 0:
		if difference // number != 0:
			c = difference // number
			count += c
			difference -= c * number
		number -= 1
	print(count)


import math
n = int(input())
for _ in range(n):
	a = list(map(int, input().split()))
	ans = 0
	c = abs(a[1] - a[0]) / 10
	ans = math.ceil(c)
	print(ans)


import math
for test in range(int(input())):
	(a, b) = map(int, input().split())
	if b >= a:
		print(int(math.ceil((b - a) / 10)))
	else:
		print(int(math.ceil((a - b) / 10)))


import math
import sys

class Graph:

	def __init__(self, Nodes, is_directed=False):
		self.nodes = Nodes
		self.adj_list = {}
		self.is_directed = is_directed
		for node in self.nodes:
			self.adj_list[node] = []

	def add_edge(self, u, v):
		if v not in self.adj_list[u]:
			self.adj_list[u].append(v)
		if self.is_directed == False:
			if u not in self.adj_list[v]:
				self.adj_list[v].append(u)

	def print_graph(self):
		for node in self.nodes:
			print(node, '->', self.adj_list[node])

	def degree_node(self, node):
		return len(self.adj_list[node])

	def dfsUTIL(self, v, visited, parents=[]):
		parents.append(v)
		visited[v] = True
		for i in self.adj_list[v]:
			if visited[i] == False:
				self.dfsUTIL(i, visited, parents)

	def dfs(self, v):
		visited = [False] * (max(self.adj_list) + 5)
		parents = []
		self.dfsUTIL(v, visited, parents)
		return parents

def dict_sort(ans):
	ans = sorted(ans.items(), reverse=True, key=lambda kv: kv[1])

def is_prime(n):
	if n == 1:
		return 0
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			return False
	return True

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def seive_primes(n):
	flag = [0] * (n + 10)
	flag[1] = flag[0] = 1
	i = 2
	while i * i <= n + 1:
		if flag[i] == 0:
			j = i * i
			while j <= n + 1:
				flag[j] = 1
				j += i
		i += 1
	return flag

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	return a * b // gcd(a, b)

def alphabates():
	return 'abcdefghijklmnopqrstuvwxyz'

def binary_search(ls, n, flag):
	low = 0
	hi = n - 1
	while low <= hi:
		mid = (low + hi) // 2
		if ls[mid] == flag:
			return mid
		elif ls[mid] > flag:
			hi = mid - 1
		else:
			low = mid + 1
	return -1

def qdrt(x, a, b, c):
	return a * x * x + b * x + c

def inp():
	ls = list(map(int, input().split()))
	return ls

def mult_inp():
	return map(int, input().split())
for _ in range(int(input())):
	(a, b) = mult_inp()
	dif = abs(b - a)
	print(math.ceil(dif / 10))


t = int(input())
ans = []
for _ in range(t):
	(a, b) = map(int, input().split())
	if a > b:
		(a, b) = (b, a)
	(x, y) = divmod(b - a, 10)
	if y != 0:
		y = 1
	else:
		y = 0
	ans.append(x + y)
print(*ans, sep='\n')


n = int(input())
for q in range(n):
	inp = input()
	lis = list((int(i) for i in inp.split()))
	a = lis[0]
	b = lis[1]
	if a >= b:
		dif = a - b
	else:
		dif = b - a
	if dif % 10 == 0:
		dif = dif
	else:
		dif = dif + (10 - dif % 10)
	print(dif // 10)


for u in range(int(input())):
	(x, y) = map(int, input().split())
	s = abs(x - y)
	if s % 10 == 0:
		print(s // 10)
	else:
		print(s // 10 + 1)


from math import ceil

def read_int() -> int:
	return int(input())

def read_ints():
	return map(int, input().split(' '))

def test_case():
	(a, b) = sorted(read_ints())
	print(ceil((b - a) / 10))
for _ in range(read_int()):
	test_case()


for t in range(int(input())):
	(n, m) = list(map(int, input().split()))
	diff = abs(n - m)
	print(diff // 10 + int(bool(diff % 10)))


def func(a, b):
	rem = abs(a - b)
	if rem % 10 == 0:
		return rem // 10
	return rem // 10 + 1
t = int(input())
for i in range(t):
	(a, b) = list(map(int, input().split()))
	print(func(a, b))


for _ in range(int(input())):
	s = [int(x) for x in input().split()]
	s.sort()
	div = (s[1] - s[0]) / 10
	if div > int(div):
		print(int(div) + 1)
	else:
		print(int(div))


t = input()
t = int(t)
for i in range(t):
	(a, b) = map(int, input().split())
	diff = abs(a - b)
	moves = diff // 10 + int(diff % 10 > 0)
	print(moves)


t = int(input())
for _ipj_ in range(t):
	(a, b) = map(int, input().split())
	tmp = abs(a - b)
	ans = tmp // 10
	if tmp % 10:
		ans += 1
	print(ans)


def check(a, b):
	if a == b:
		return 0
	else:
		t = abs(a - b)
		if t % 10 == 0:
			return t // 10
		else:
			return t // 10 + 1
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	print(check(a, b))


from functools import reduce
import collections
import math
import sys

class Read:

	@staticmethod
	def string():
		return input()

	@staticmethod
	def int():
		return int(input())

	@staticmethod
	def list(delimiter=' '):
		return input().split(delimiter)

	@staticmethod
	def list_int(delimiter=' '):
		return list(map(int, input().split(delimiter)))

def main():
	t = Read.int()
	for _ in range(t):
		(a, b) = Read.list_int()
		if a == b:
			print(0)
		elif a > b:
			if (a - b) % 10 == 0:
				print((a - b) // 10)
			else:
				print((a - b) // 10 + 1)
		elif (b - a) % 10 == 0:
			print((b - a) // 10)
		else:
			print((b - a) // 10 + 1)
main()


import math
tc = int(input())
while tc > 0:
	tc -= 1
	(a, b) = map(int, input().split())
	print(int(math.ceil(abs(a - b) / 10)))


import math
for _ in range(int(input())):
	number = list(map(int, input().split()))
	a = number[0]
	b = number[1]
	ans = math.ceil(abs(a - b) / 10)
	print(ans)


def equal(a, b):
	count = 0
	if a > b:
		c = (a - b) // 10
		if (a - b) % 10 != 0:
			count += 1 + c
		else:
			count += c
	elif b > a:
		c = (b - a) // 10
		if (b - a) % 10 != 0:
			count += 1 + c
		else:
			count += c
	return count
n = int(input())
for i in range(n):
	(x, y) = input().split()
	print(equal(int(x), int(y)))


def main():
	for _ in range(int(input())):
		(a, b) = [int(i) for i in input().split()]
		n = abs(a - b)
		res = n // 10
		if n % 10 != 0:
			res += 1
		print(res)
main()


def saurabh(a, b):
	if a == b:
		return 0
	x = abs(a - b)
	q = x // 10
	if x == q * 10:
		return q
	return q + 1
for i in range(int(input())):
	(a, b) = list(map(int, input().split()))
	print(saurabh(a, b))


import math

def moves(ab):
	return math.ceil(abs(ab[0] - ab[1]) / 10)
ar = []
count = int(input())
for _ in range(count):
	ar.append(list(map(int, input().split())))
for i in ar:
	print(moves(i))


t = int(input())
while t:
	(a, b) = tuple(map(int, input().split()))
	dif = abs(a - b)
	step = 10
	ans = 0
	while dif:
		ans += int(dif // step)
		dif = dif % step
		step -= 1
	print(ans)
	t -= 1


import math, queue, heapq
import sys
sys.setrecursionlimit(10 ** 6)
fastinput = sys.stdin.readline
fastout = sys.stdout.write
t = int(fastinput())
while t:
	t -= 1
	(a, b) = map(int, fastinput().split())
	x = abs(a - b)
	print(x // 10 + (0 if x % 10 == 0 else 1))


import sys
input = lambda : sys.stdin.readline().rstrip()
from math import ceil
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	ans = abs(b - a)
	print(ceil(ans / 10))


t = int(input())
arr = []
for i in range(t):
	(a, b) = map(int, input().split())
	arr.append((a, b))
for i in range(t):
	print((abs(arr[i][1] - arr[i][0]) - 1) // 10 + 1)


t = int(input())
k = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
for _ in range(t):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	else:
		x = max(a, b)
		y = min(a, b)
		diff = x - y
		ctr = 0
		for i in range(len(k) - 1, 0, -1):
			a = diff // k[i]
			ctr += a
			diff -= a * k[i]
		print(ctr)


def solve(a, b):
	diff = abs(a - b)
	rem = diff % 10
	diff //= 10
	if rem > 0:
		ans = diff + 1
	else:
		ans = diff
	print(ans)
n = int(input())
for i in range(n):
	l = list(map(int, input().split()))
	solve(l[0], l[1])


for TC in range(int(input())):
	(a, b) = map(int, input().split())
	if a < b:
		(a, b) = (b, a)
	c = (a - b) // 10
	print(c if not (a - b) % 10 else c + 1)


import sys, math
wtf = sys.stdin.read()
wtf = wtf.strip().split('\n')
t = int(wtf[0])
assert t >= 1 and t <= int(200000.0) and (t == len(wtf[1:])), 'Precondition failure'
for w in wtf[1:]:
	(a, b) = map(int, w.split(' '))
	c = abs(a - b)
	print(c // 10 + (1 if c % 10 > 0 else 0))


out = list()
k = int(input())
for i in range(0, k):
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	if a == b:
		out.append(0)
	if a > b:
		if (a - b) % 10 == 0:
			out.append((a - b) // 10)
		else:
			out.append((a - b) // 10 + 1)
	if a < b:
		if (b - a) % 10 == 0:
			out.append((b - a) // 10)
		else:
			out.append((b - a) // 10 + 1)
for i in out:
	print(i)


t = int(input())
for _ in range(t):
	(n1, n2) = list(map(int, input().rstrip().split()))
	if n1 == n2:
		print(0)
	else:
		diff = max(n1, n2) - min(n1, n2)
		choice = 0
		for i in range(10, 0, -1):
			if diff // i > 0:
				choice = i
				break
		if diff % choice == 0:
			print(diff // choice)
		else:
			print(diff // choice + 1)


for _ in range(int(input())):
	l = [int(c) for c in input().split()]
	a = l[0]
	b = l[1]
	n = abs(a - b) / 10
	if n - int(n) > 0:
		n += 1
	n = int(n)
	print(n)


t = int(input())
res = ''
for _t in range(t):
	(a, b) = list(map(int, input().split()))
	if b > a:
		(a, b) = (b, a)
	moves = 0
	if a != b:
		x = int((a - b) / 10)
		if a - x * 10 == b:
			moves = x
		else:
			moves = x + 1
	res += str(moves) + '\n'
print(res)


import math
t = int(input())
for z in range(t):
	(a, b) = map(int, input().split())
	print(math.ceil(abs(b - a) / 10))


x = int(input())
p = []
for i in range(x):
	(a, b) = map(int, input().split())
	g = (abs(a - b) + 9) // 10
	p.append(g)
print(*p, sep='\n')


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(a, b) = (int(i) for i in input().split())
	if a > b:
		(a, b) = (b, a)
	res = (b - a) // 10 + (1 if (b - a) % 10 else 0)
	print(res)


t = int(input())
for t_qtr in range(t):
	nk = input().split()
	n = int(nk[0])
	k = int(nk[1])
	a = k - n
	a = abs(a)
	if a == 0:
		print(0)
	elif a % 10 == 0:
		print(int(a / 10))
	else:
		c = a // 10
		c = c + 1
		print(int(c))


def abs(n):
	return -n if n < 0 else n
tc = int(input())
for t in range(tc):
	(a, b) = [int(i) for i in input().split(' ')]
	if a == b:
		print('0')
	else:
		r = abs(a - b) // 10
		r += 1 if abs(a - b) % 10 != 0 else 0
		print(r)


for _ in range(int(input())):
	(a, b) = list(map(int, input().split(' ')))
	if a == b:
		print(0)
	elif a > b:
		val = a - b
		if val % 10 == 0:
			print(val // 10)
		else:
			print(val // 10 + 1)
	else:
		va = b - a
		if va % 10 == 0:
			print(va // 10)
		else:
			print(va // 10 + 1)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

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

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

def N():
	return int(input())

def print_list(l):
	print(' '.join(map(str, l)))
from math import ceil, floor, sqrt, pow
n = int(input())
for _ in range(n):
	(a, b) = map(int, sys.stdin.readline().rstrip().split())
	print(ceil(abs(a - b) / 10))


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	z = abs(a - b)
	(x, y) = divmod(z, 10)
	if y >= 1:
		print(x + 1)
	else:
		print(x)


t = int(input())
answer = []
while t > 0:
	(a, b) = list(map(int, input().split()))
	ans = (abs(a - b) + 9) // 10
	answer.append(ans)
	t -= 1
for i in answer:
	print(i)


import math
t = int(input())
while t > 0:
	k = input()
	a = int(k.split(' ')[0])
	b = int(k.split(' ')[1])
	out = abs(a - b) / 10
	if abs(a - b) % 10 != 0:
		out = out + 1
	print(int(out))
	t = t - 1


a = int(input())
for _ in range(a):
	(b, c) = map(int, input().split())
	e = max(c, b)
	f = e + e - c - b
	g = f + 9
	h = g // 10
	print(h)


T = int(input())
for t in range(T):
	ab = list(map(int, input().split()))
	a = ab[0]
	b = ab[1]
	c = 0
	if a < b:
		while a != b:
			if b - a <= 10:
				c += 1
				a = b
			else:
				t = (b - a) // 10
				a += t * 10
				c += t
	else:
		while a != b:
			if a - b <= 10:
				c += 1
				a = b
			else:
				t = (a - b) // 10
				a -= t * 10
				c += t
	print(c)


import math
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	c = abs(a - b)
	if a == b:
		print(c)
	else:
		k = c // 10
		if c % 10 == 0:
			print(math.floor(k))
		else:
			print(math.floor(k) + 1)


t = int(input())
for T in range(t):
	(a, b) = map(int, input().split())
	raz = abs(a - b)
	print((raz + 9) // 10)


import sys, math
input = sys.stdin.readline
t = int(input())
for r in range(t):
	(a, b) = map(int, input().split())
	x = abs(a - b)
	if x % 10 == 0:
		print(x // 10)
	else:
		print(x // 10 + 1)


T = int(input())
while T:
	T -= 1
	(a, b) = [int(i) for i in input().split()]
	print(str(-(-abs(a - b) // 10)))


t = int(input())
i = 0
while i < t:
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	v = abs(a - b)
	if v % 10 == 0:
		print(v // 10)
	else:
		print(v // 10 + 1)
	i += 1


import sys
input = sys.stdin.readline
read = lambda : map(int, input().split())

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def factorial(x, m):
	val = 1
	while x > 0:
		val = val * x % m
		x -= 1
	return val

def fact(x):
	val = 1
	while x > 0:
		val *= x
		x -= 1
	return val

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	return a * b // gcd(a, b)

def nCr(n, k):
	if k > n:
		return 0
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def upper_bound(a, x, lo=0, hi=None):
	if hi == None:
		hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if a[mid] < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	(prime[0], prime[1]) = (False, False)
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def phi(n):
	result = n
	p = 2
	while p * p <= n:
		if n % p == 0:
			while n % p == 0:
				n = n // p
			result = result * (1.0 - 1.0 / float(p))
		p = p + 1
	if n > 1:
		result = result * (1.0 - 1.0 / float(n))
	return int(result)

def is_prime(n):
	if n == 0:
		return False
	if n == 1:
		return True
	for i in range(2, int(n ** (1 / 2)) + 1):
		if not n % i:
			return False
	return True
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
spf = [0 for i in range(MAXN)]

def factoriazation(x):
	res = []
	for i in range(2, int(x ** 0.5) + 1):
		while x % i == 0:
			res.append(i)
			x //= i
	if x != 1:
		res.append(x)
	return res

def factors(n):
	res = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			res.append(i)
			res.append(n // i)
	return list(set(res))

def int_array():
	return list(map(int, input().strip().split()))

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
from itertools import permutations
import math
from bisect import bisect_left

def solve():
	(a, b) = read()
	print(math.ceil(abs(a - b) / 10))
for _ in range(int(input())):
	solve()


t = int(input())
while t != 0:
	(a, b) = map(int, input().split())
	temp = abs(a - b)
	k = 10
	count = 0
	while temp != 0:
		count += temp // k
		temp = temp % k
		k -= 1
	print(count)
	t -= 1


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	x = abs(b - a)
	ans = x // 10
	if x % 10:
		ans += 1
	print(ans)


times = int(input())
ctr = 0
while ctr < times:
	nums = input().split(' ')
	number = [int(x) for x in nums]
	a = number[0]
	b = number[1]
	ans = abs(a - b) / 10
	if abs(a - b) % 10 != 0:
		ans += 1
	print(int(ans))
	ctr += 1


t = int(input())
for _ in range(t):
	(a, b) = list(map(int, input().split()))
	print((abs(a - b) + 10 - 1) // 10)


n = int(input())
for i in range(n):
	nums = list(map(int, input().split(' ')))
	a = nums[0]
	b = nums[1]
	res = abs(a - b) // 10
	if (a - b) % 10 != 0:
		res += 1
	print(res)


def solve(a, b):
	diff = abs(b - a)
	(n, r) = divmod(diff, 10)
	return n + 1 if r > 0 else n
n = int(input())
for i in range(n):
	(a, b) = [int(x) for x in input().split(' ')]
	print(solve(a, b))


def get_strings():
	str_list = []
	first_str = input()
	for i in range(int(first_str)):
		q = input()
		str_list.append(q)
	return str_list

def calculate_2(a, b):
	c = a - b
	k = 10
	count = 0
	if c > k:
		count = c / k
		if c % k == 0:
			return c // k
		else:
			return c // k + 1
	else:
		return 1

def calculate(str):
	int_str = str.split(' ')
	a = int(int_str[0])
	b = int(int_str[1])
	if a - b == 0:
		return 0
	if a > b:
		return calculate_2(a, b)
	else:
		return calculate_2(b, a)
list_strings = get_strings()
list_output = []
for i in list_strings:
	end_calc = calculate(i)
	list_output.append(end_calc)
	print(end_calc)


import math
t = int(input())
for q in range(0, t):
	(n, m) = map(int, input().split())
	m1 = min(n, m)
	m2 = max(n, m)
	ans = math.ceil((m2 - m1) / 10)
	print(ans)


for i in range(int(input())):
	(a, b) = list(map(int, input().split()))
	diff = abs(a - b)
	cnt = 0
	for i in range(10, 0, -1):
		cnt += diff // i
		if diff % i == 0:
			print(cnt)
			break
		else:
			diff = diff % i


def pro(a, b):
	n = abs(a - b)
	ans = n // 10
	n = n % 10
	if n == 0:
		return ans
	return ans + 1
t = int(input())
for i in range(t):
	arr = list(map(int, input().split()))
	(a, b) = (arr[0], arr[1])
	print(pro(a, b))


def run_case():
	(a, b) = map(int, input().split())
	temp = abs(b - a)
	if temp % 10 == 0:
		print(temp // 10)
	else:
		print(temp // 10 + 1)
flag = 1
if flag:
	t = int(input())
	for i in range(t):
		run_case()
else:
	run_case()


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(1000000)
	threading.stack_size(1024000)
	thread = threading.Thread(target=main)
	thread.start()
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[1]

def sort2(l):
	return sorted(l, key=getKey, reverse=True)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def ceil(x, y):
	if x % y == 0:
		return x // y
	else:
		return x // y + 1

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

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

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def main():
	t = int(input())
	for i in range(t):
		(a, b) = map(int, input().split())
		print((abs(b - a) + 9) // 10)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


for s in [*open(0)][1:]:
	(a, b) = map(int, s.split())
	if (a - b) % 10 == 0:
		x = abs(b - a) / 10
	else:
		x = abs(b - a) / 10 + 1
	print(int(x))


t = int(input())
cases = []
while t > 0:
	cases.append([int(x) for x in input().split(' ')])
	t -= 1
for case in cases:
	moves = 0
	if case[0] == case[1]:
		print(moves)
		continue
	else:
		df = abs(case[0] - case[1])
		i = 10
		while i > 0:
			if df // i:
				moves += df // i
				df -= df // i * i
			i -= 1
		print(moves)


import sys
t = int(sys.stdin.readline())
for num in range(t):
	(a, b) = map(int, sys.stdin.readline().split())
	if a >= b:
		dif = a - b
	else:
		dif = b - a
	if dif % 10 == 0:
		print(dif // 10)
	else:
		print(dif // 10 + 1)


n = int(input())
while n != 0:
	(a, b) = map(int, input().split())
	m = abs(a - b)
	if m % 10 != 0:
		c = int(m / 10) + 1
	elif m % 10 == 0:
		c = int(m / 10)
	print(c)
	n -= 1


import math
t = int(input())
for i in range(t):
	inputs = list(map(int, input().split()))
	(a, b) = (inputs[0], inputs[1])
	r = math.ceil(abs(b - a) / 10)
	print(r)


import math
t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	d = abs(a - b)
	n = d // 10
	if d % 10 != 0:
		n = n + 1
	print(n)


import sys

def get_ints():
	return map(int, I().split())

def get_list():
	return list(map(int, I().split()))

def I():
	return sys.stdin.readline()
t = int(I())
for k in range(t):
	(a, b) = get_ints()
	c = abs(a - b)
	if c == 0:
		print(0)
	elif c <= 10:
		print(1)
	elif c > 10 and c % 10 == 0:
		print(c // 10)
	else:
		print(c // 10 + 1)


t = int(input())
while t:
	t -= 1
	(a_, b_) = input().split(' ')
	a = int(a_)
	b = int(b_)
	absab = abs(a - b)
	ans = 0
	ans = absab // 10
	if absab % 10:
		ans += 1
	print(ans)


import math
t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	r = abs(a - b)
	if r == 0:
		print(0)
	elif r <= 10:
		print(1)
	else:
		ans = math.floor(r / 10)
		if r % 10 == 0:
			print(ans)
		else:
			print(ans + 1)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	difference = abs(a - b)
	(d, m) = divmod(difference, 10)
	if m > 0:
		d += 1
	print(d)


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	print('%d' % int((max(a, b) - min(a, b) + 9) // 10))


t = int(input())
fin = []
for i in range(t):
	a = list(map(int, input().split()))
	fin.append(a)
for j in fin:
	a = j[0]
	b = j[1]
	if a == b:
		print(0)
	elif a > b:
		if (a - b) % 10 == 0:
			print((a - b) // 10)
		else:
			print((a - b) // 10 + 1)
	elif (b - a) % 10 == 0:
		print((b - a) // 10)
	else:
		print((b - a) // 10 + 1)


import math

def find_ans(a, b):
	n = abs(a - b)
	print(math.ceil(n / 10))
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	find_ans(a, b)


import math
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if abs(a - b) % 10 != 0:
		if a > b:
			print(math.ceil((a - b) // 10) + 1)
		elif a == b:
			print(0)
		else:
			print(math.ceil((b - a) // 10) + 1)
	elif a > b:
		print(math.ceil((a - b) // 10))
	elif a == b:
		print(0)
	else:
		print(math.ceil((b - a) // 10))


t = int(input())
while t:
	(a, b) = map(int, input().split())
	diff = abs(a - b)
	count = diff // 10
	rem = diff % 10
	if rem != 0:
		count += 1
	print(count)
	t -= 1


a = int(input())
i = 1
while i <= a:
	b = [int(x) for x in input().split()]
	c = max(b[0], b[1])
	d = min(b[0], b[1])
	e = c - d
	e = e / 10
	if e % 1 == 0:
		print(int(e))
	else:
		print(int(e) + 1)
	i += 1


import sys, os.path, math
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
sys.setrecursionlimit(10 ** 5)

def ii():
	return int(sys.stdin.readline())

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

def li():
	return list(map(int, sys.stdin.readline().split()))
print = sys.stdout.write

def solve():
	(a, b) = mi()
	print(str(math.ceil(abs(a - b) / 10)) + '\n')
for _ in range(ii()):
	solve()


import sys, collections
input = sys.stdin.readline
n = int(input())
for _ in range(n):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
		continue
	if a < b:
		(a, b) = (b, a)
	x = a % 10
	y = b % 10
	ans = 0
	if x > y:
		ans += 1
	a += -x
	b += -y
	z = a - b
	z //= 10
	ans += z
	print(ans)


for x in range(int(input())):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	else:
		c = abs(a - b) // 10
		d = abs(a - b) % 10
		if d != 0:
			c += 1
		print(c)


import math
for _ in range(int(input())):
	(x, y) = map(int, input().split())
	p = abs(x - y)
	if p % 10 == 0:
		print(p // 10)
	else:
		print(p // 10 + 1)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	sub = abs(a - b)
	total = sub // 10
	if sub % 10 < 10 and sub % 10 != 0:
		total += 1
	print(total)


import math
import sys
from collections import deque
import heapq

def inp():
	return sys.stdin.readline().rstrip()

def mpp():
	return map(int, inp().split())

def lis():
	return list(mpp())

def sol(a, b):
	if a == b:
		return 0
	if a < b:
		temp = (b - a) % 10
		return (b - a) // 10 + 1 if temp != 0 else (b - a) // 10
	else:
		temp = (a - b) % 10
		return (a - b) // 10 + 1 if temp != 0 else (a - b) // 10

def main():
	t = int(inp())
	for _ in range(t):
		(a, b) = mpp()
		print(sol(a, b))
main()


def check():
	if False:
		print('hello')

def solve():
	t = int(input())
	for i in range(t):
		(aa, bb) = list(map(int, input().split()))
		if abs(aa - bb) % 10 == 0:
			print(abs(aa - bb) // 10)
		else:
			print(abs(aa - bb) // 10 + 1)
check()
solve()


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	elif a < b and a + 10 >= b or (a > b and a - 10 <= b):
		print(1)
	else:
		razn = abs(a - b) / 10
		if int(razn) - razn != 0:
			razn = int(razn) + 1
		print(int(razn))


import math
t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	if math.fabs(b - a) % 10 == 0:
		print(int(math.fabs(a - b) // 10))
	else:
		print(int(math.fabs(a - b) // 10 + 1))


import sys
from math import ceil
put = sys.stdin.readline
t = int(put())
while t:
	t -= 1
	(a, b) = map(int, put().split())
	print(ceil(abs(a - b) / 10))


t = int(input(''))
for i in range(t):
	(a, b) = map(int, input('').split())
	sub = abs(a - b)
	if sub > 10:
		s = sub // 10
		if sub % 10 != 0:
			total = s + 1
			print(total)
		else:
			print(s)
	elif sub == 0:
		print('0')
	else:
		print('1')


for _ in range(int(input())):
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	minInt = min(a, b)
	maxInt = max(a, b)
	diff = maxInt - minInt
	if diff % 10 == 0:
		print(int(diff / 10))
	else:
		print(int(diff / 10 + 1))


cases = int(input())
for i in range(cases):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	else:
		x = max(a, b)
		y = min(a, b)
		chances = 0
		chances += (x - y) // 10
		if (x - y) % 10 != 0:
			chances += 1
		print(chances)


for iii in range(int(input())):
	(a, b) = [int(x) for x in input().split()]
	dif = abs(b - a)
	ans = 0
	i = 10
	while dif != 0:
		if dif / i != 0:
			ans = ans + int(dif / i)
		dif = dif - i * int(dif / i)
		i = i - 1
	print(ans)


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	s = abs(a - b)
	x = int(s / 10)
	if s - x * 10 != 0:
		ans = x + 1
	else:
		ans = x
	print(ans)


import sys
pin = sys.stdin.readline
for t in range(int(pin())):
	(a, b) = map(int, pin().split())
	print((abs(b - a) - 1) // 10 + 1)


import sys
from sys import stdin, stdout
import math
import random
import heapq
from collections import Counter
from functools import lru_cache
try:
	for _ in range(int(input())):
		(a, b) = map(int, input().split())
		if a == b:
			print(0)
		else:
			diff = abs(a - b)
			if diff % 10 == 0:
				print(diff // 10)
			else:
				print(diff // 10 + 1)
except EOFError as e:
	print(e)


def check(a, b):
	arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
	if a == b:
		return 0
	if a > b:
		s = a - b
		q = s // 10
		r = s % 10
		if r in arr:
			q = q + 1
		return q
	elif b > a:
		s = b - a
		q = s // 10
		r = s % 10
		if r in arr:
			q = q + 1
		return q
for _ in range(int(input())):
	(a, b) = input().split()
	print(check(int(a), int(b)))


t = int(input())
for tt in range(t):
	(a, b) = input().split(' ')
	(a, b) = (int(a), int(b))
	ans = abs(a - b) // 10
	if abs(a - b) % 10:
		print(ans + 1)
	else:
		print(ans)


for _ in range(int(input())):
	(a, b) = list(map(int, input().split()))
	x = abs(b - a)
	result = x // 10
	if x % 10 != 0:
		result += 1
	print(result)


def main():
	t = int(input())
	for _ in range(t):
		ed = 0
		(a, b) = list(map(int, input().strip().split()))
		dif = abs(a - b)
		ed += dif // 10
		if dif % 10 > 0:
			ed += 1
		print(ed)
main()


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	k = abs(a - b)
	if a == b:
		print('0')
	elif k % 10 == 0:
		m = k // 10
		print(m % 1000000007)
	else:
		p = k // 10 + 1
		print(p % 1000000007)


t = int(input())
for i in range(t):
	(m, n) = [int(m) for m in input().split()]
	z = abs(n - m)
	e = z % 10
	z = z // 10
	if e:
		z += 1
	ans = z
	print(ans)


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	count = abs(a - b) // 10
	if abs(a - b) % 10:
		count += 1
	print(count)


def ans(a, b):
	if a == b:
		return 0
	x = abs(a - b)
	if x % 10 == 0:
		return x // 10
	return x // 10 + 1
m = int(input())
for j in range(m):
	arr = input().split()
	a = int(arr[0])
	b = int(arr[1])
	print(ans(a, b))


cases = int(input())
for each in range(0, cases):
	ans = 0
	array = input()
	a = int(array.split(' ')[0])
	b = int(array.split(' ')[-1])
	if a > b:
		nums = range(b, a + 1)
	else:
		nums = range(a, b + 1)
	digits = len(nums) - 2
	if a == b:
		ans = 0
	else:
		ans += digits // 10 + 1
	print(ans)


import math
t = int(input())
ANS = []
for i in range(t):
	(x, y) = input().split()
	x = int(x)
	y = int(y)
	if y > x:
		(x, y) = (y, x)
	count = 0
	if x == y:
		ANS.append(0)
	if x != y:
		if x - y <= 10:
			ANS.append(1)
		if x - y > 10:
			temp = math.floor((x - y) / 10)
			if temp != (x - y) / 10:
				temp = temp + 1
			ANS.append(temp)
for i in range(t):
	print(ANS[i])


for i in range(int(input())):
	(a, b) = map(int, input().split())
	x = a % 10
	y = b % 10
	c = a - x
	d = b - y
	if b > a:
		if y > x:
			print(int((d - c) / 10) + 1)
		else:
			print(int((d - c) / 10))
	elif a == b:
		print(0)
	elif x > y:
		print(int((c - d) / 10) + 1)
	else:
		print(int((c - d) / 10))


result = []
for _ in range(int(input())):
	(a, b) = list(map(int, input().split()))
	difference = abs(a - b)
	if difference % 10 == 0:
		result.append(str(difference // 10))
	else:
		result.append(str(difference // 10 + 1))
print('\n'.join(result))


t = int(input())
for i in range(t):
	(a, b) = input().split()
	(a, b) = (int(a), int(b))
	if a > b:
		temp = a
		a = b
		b = temp
	if a == b:
		print(0)
	else:
		x = b - a
		count = 0
		j = 10
		while j > 0:
			if x != 0:
				count += x // j
				x = x % j
			else:
				break
			j -= 1
		print(count)


for _ in range(int(input())):
	(ar, b) = map(int, input().split())
	count = 0
	if ar == b:
		print('0')
		continue
	else:
		a = 0
		te = 0
		diff = abs(ar - b)
		while diff != 0:
			if diff / 10 >= 1:
				a = diff // 10
				count += a
				diff -= a * 10
			elif diff / 9 >= 1:
				a = diff // 9
				count += a
				diff -= a * 9
			elif diff / 8 >= 1:
				a = diff // 8
				count += a
				diff -= a * 8
			elif diff / 7 >= 1:
				a = diff // 7
				count += a
				diff -= a * 7
			elif diff / 6 >= 1:
				a = diff // 6
				count += a
				diff -= a * 6
			elif diff / 5 >= 1:
				a = diff // 5
				count += a
				diff -= a * 5
			elif diff / 4 >= 1:
				a = diff // 4
				count += a
				diff -= a * 4
			elif diff / 3 >= 1:
				a = diff // 3
				count += a
				diff -= a * 3
			elif diff / 2 >= 1:
				a = diff // 2
				count += a
				diff -= a * 2
			else:
				count += 1
				diff -= 1
		print(count)


t = int(input())
for _ in range(t):
	(a, b) = list(map(int, input().split()))
	t1 = abs(a - b)
	if a == b:
		print(0)
	elif t1 <= 10:
		print(1)
	else:
		t2 = t1 // 10
		if t2 * 10 == t1:
			print(t2)
		else:
			print(t2 + 1)


(z, zz) = (input, lambda : list(map(int, z().split())))
zzz = lambda : [int(i) for i in stdin.readline().split()]
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))
from string import *
from re import *
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f
from bisect import bisect as bs
from bisect import bisect_left as bsl
from itertools import accumulate as ac

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0 and x != 2 or x == 0:
			return 0
	return 1

def dfs(u, visit, graph):
	visit[u] = True
	for i in graph[u]:
		if not visit[i]:
			dfs(i, visit, graph)
num = int(z())
for _ in range(num):
	ans = 0
	(a, b) = sorted(zz())
	t = abs(a - b) // 10
	ans += t
	x = abs(a - b) % 10
	if x != 0:
		ans += 1
	print(ans)


import sys
from collections import deque
input = sys.stdin.readline
T = int(input())
for i in range(T):
	(a, b) = map(int, input().split())
	n = abs(a - b)
	if n % 10:
		print(n // 10 + 1)
	else:
		print(abs(a - b) // 10)


for i in range(int(input())):
	(a, b) = list(map(int, input().split()))
	c = 0
	x = abs(a - b)
	c += x // 10
	if x % 10 != 0:
		c += 1
	print(c)


import math
test = int(input())
for i in range(test):
	(a, b) = [int(x) for x in input().split(' ')]
	ans = math.ceil((max(a, b) - min(a, b)) / 10)
	print(ans)


import sys
input = sys.stdin.readline
T = int(input())
for _ in range(T):
	(a, b) = map(int, input().split())
	diff = abs(a - b)
	if diff % 10 == 0:
		print(diff // 10)
	else:
		print(diff // 10 + 1)


for _ in range(int(input())):
	a = list(map(int, input().split()))
	c = max(a) - min(a)
	if c % 10 == 0:
		print(c // 10)
	else:
		print(c // 10 + 1)


import sys
lines = []
for line in sys.stdin:
	if 'exit' == line.rstrip():
		break
	lines.append(line)
t = int(lines[0])
for case in range(1, t + 1):
	(a, b) = [int(x) for x in lines[case].split(' ')]
	if a == b:
		print(0)
	else:
		ans = abs(b - a) // 10
		d = (b - a) % 10
		if d != 0:
			print(ans + 1)
		else:
			print(ans)


T = int(input())
for t in range(T):
	(a, b) = [int(i) for i in input().split()]
	print((abs(b - a) + 9) // 10)


from sys import stdin, stdout
from sys import maxsize
from math import ceil
input = stdin.readline

def solve():
	pass
test = 1
test = int(input().strip())
for t in range(0, test):
	(n, k) = list(map(int, input().strip().split()))
	print(int(ceil(abs(n - k) / 10)))
	ans = solve()


def steps(a, b):
	gap = a - b
	res = gap // 10
	reminder = gap % 10
	if reminder == 0:
		return res
	else:
		return res + 1
n = int(input())
li = []
for _ in range(n):
	(a, b) = map(int, input().split())
	if a > b:
		s = steps(a, b)
		li.append(s)
	elif a == b:
		li.append(0)
	else:
		s = steps(b, a)
		li.append(s)
for items in li:
	print(items)


from math import floor
t = int(input())
while t:
	(a, b) = list(map(int, input().split()))
	print(floor((abs(a - b) + 9) / 10))
	t -= 1


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	else:
		diff = abs(b - a)
		q = diff // 20
		r = diff % 20
		if r == 0:
			print(2 * q)
		elif r <= 10:
			print(2 * q + 1)
		else:
			print(2 * q + 2)


import sys, collections, math

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

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

def input():
	return sys.stdin.readline().strip()
mod = 1000000007
for _ in range(int(input())):
	(a, b) = get_ints()
	if a == b:
		print(0)
		continue
	ans = max(a, b) - min(a, b)
	if ans % 10 == 0:
		print(ans // 10)
	else:
		print(ans // 10 + 1)


for _ in range(int(input())):
	(A, B) = map(int, input().split())
	print(0 - -abs(A - B) // 10)


import math
for _ in range(int(input())):
	(a, b) = input().split()
	dis = abs(int(a) - int(b))
	print(math.ceil(dis * 1.0 / 10))


for s in [*open(0)][1::1]:
	from math import ceil
	(a, b) = map(int, s.strip().split())
	print(ceil(abs(a - b) / 10) if abs(a - b) else 0)


n = int(input())
l = []
for i in range(n):
	a = list(map(int, input().split()))
	l.append(a)
for i in range(n):
	x = abs(l[i][0] - l[i][1])
	if x > 10:
		b = int(x / 10)
		c = x % 10
		if c > 0:
			print(b + 1)
		elif c == 0:
			print(b)
	elif x == 0:
		print(0)
	else:
		print(1)


c = int(input())
for x in range(c):
	c = [int(x) for x in input().split(' ')]
	if c[0] > c[1]:
		(c[0], c[1]) = (c[1], c[0])
	if (c[1] - c[0]) / 10 > (c[1] - c[0]) // 10:
		print((c[1] - c[0]) // 10 + 1)
	else:
		print((c[1] - c[0]) // 10)


n = int(input())
ans = [0] * n
for i in range(n):
	s = input().split(' ')
	a = abs(int(s[1]) - int(s[0]))
	ans[i] = a // 10
	if a % 10 != 0:
		ans[i] += 1
for i in range(n):
	print(ans[i])


n = int(input())
for _ in range(n):
	(a, b) = list(map(int, input().split(' ')))
	if a > b:
		(a, b) = (b, a)
	diff = b - a
	c = 0
	c += diff // 10
	diff = diff % 10
	if diff:
		c += 1
	print(c)


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	diff = abs(a - b)
	count = 0
	k = 10
	while diff > 0:
		temp = diff // k
		count += temp
		diff -= temp * k
		k -= 1
	print(count)


for ik in range(int(input())):
	(a, b) = map(int, input().split())
	dif = abs(b - a)
	ans = 0
	for i in range(10, 0, -1):
		ans += dif // i
		dif -= dif // i * i
	print(ans)


ar = list(range(1, 11))
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	else:
		c = 0
		d = abs(b - a)
		for i in range(10):
			cu = ar[9 - i]
			c += d // cu
			d %= cu
		print(c)


for q in range(int(input())):
	(a, b) = map(int, input().split())
	if a > b:
		(a, b) = (b, a)
	y = b - a
	res = y // 10
	if y % 10 != 0:
		res += 1
	print(res)


test = int(input())
result = []
for t in range(test):
	ab = [int(num) for num in input().split()]
	c = ab[1] - ab[0]
	if c < 0:
		c *= -1
	if c == 0:
		result.append(0)
	elif c % 10 == 0:
		result.append(int(c / 10))
	else:
		result.append(int(c // 10 + 1))
for r in range(len(result)):
	print(result[r])


t = int(input())
p = []
q = []
for i in range(t):
	u = list(map(int, input().split()))
	p.append(u)

def tully(p, q):
	if p > q:
		t = p - q
	else:
		t = q - p
	if t == 0:
		return 0
	else:
		count = t // 10
		if t % 10 == 0:
			return count
		else:
			return count + 1
for i in range(t):
	t = tully(p[i][0], p[i][1])
	print(t)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	c = 0
	if a == b:
		print(0)
	elif a < b:
		n = b - a
		for i in range(10, 0, -1):
			if i <= n:
				c += n // i
				n = n % i
			elif n == 0:
				break
		print(c)
	else:
		n = a - b
		for i in range(10, 0, -1):
			if i <= n:
				c += n // i
				n = n % i
			elif n == 0:
				break
		print(c)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	rem = abs(a - b)
	i = 10
	count = 0
	while i >= 0:
		temp = rem // i
		if temp > 0:
			count += temp
			rem -= i * temp
		i -= 1
		if rem == 0:
			break
	print(count)


lst = []
for i in range(int(input())):
	tem = input().split()
	a = int(tem[0])
	b = int(tem[1])
	moves = int((abs(a - b) + 9) / 10)
	lst.append(moves)
for i in lst:
	print(i)


for s in [*open(0)][1:]:
	(a, b) = map(int, s.split())
	print((abs(a - b) + 9) // 10)


import math
from collections import deque
import sys
sys.setrecursionlimit(10 ** 4)

def Divisors(n):
	l = []
	i = 2
	while i <= math.sqrt(n):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
		i = i + 1
	return l

def SieveOfEratosthenes(n):
	l = []
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	for p in range(2, n + 1):
		if prime[p]:
			l.append(p)
	return l

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(i)
			n = n / i
	if n > 2:
		l.append(n)
	return l

def Factors(n):
	result = []
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			if i == n / i:
				result.append(i)
			else:
				result.append(i)
				result.append(n // i)
	result.append(1)
	return result

def maxSubArraySum(a):
	max_so_far = 0
	max_ending_here = 0
	size = len(a)
	for i in range(0, size):
		max_ending_here = max_ending_here + a[i]
		if max_so_far < abs(max_ending_here):
			max_so_far = max_ending_here
	return max_so_far

def longestsubarray(arr, n, k):
	current_count = 0
	max_count = 0
	for i in range(0, n, 1):
		if arr[i] % k != 0:
			current_count += 1
		else:
			current_count = 0
		max_count = max(current_count, max_count)
	return max_count

def main():
	(a, b) = list(map(int, input().split()))
	if (max(a, b) - min(a, b)) % 10 == 0:
		print((max(a, b) - min(a, b)) // 10)
	else:
		print((max(a, b) - min(a, b)) // 10 + 1)
t = int(input())
for i in range(0, t):
	main()


def solver(pc, py):
	d = abs(pc - py)
	return d // 10 + (1 if d % 10 != 0 else 0)
for i in range(int(input())):
	(pc, pr) = map(int, input().split())
	print(solver(pc, pr))


def gt():
	return list(map(int, input().split()))
(n,) = gt()
while n:
	n -= 1
	(a, b) = gt()
	print((abs(a - b) + 9) // 10)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(a, b) = [int(j) for j in input().split()]
	if a == b:
		print(0)
	else:
		dif = abs(a - b)
		if dif % 10 == 0:
			print(dif // 10)
		else:
			print(dif // 10 + 1)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if a > b:
		(a, b) = (b, a)
	d = b - a
	ans = d // 10
	if d % 10:
		ans += 1
	print(ans)


t = int(input())
while t > 0:
	(num1, num2) = list(map(int, input().split(' ')))
	diff = abs(num2 - num1)
	ans = diff // 10
	if diff % 10 != 0:
		ans += 1
	print(ans)
	t -= 1


def solver(a, b):
	if a > b:
		(a, b) = (b, a)
	return str((b - a) // 10 + 1 * bool((b - a) % 10))
t = int(input())
ans = []
for _ in range(t):
	(a, b) = list(map(int, input().split()))
	ans.append(solver(a, b))
print('\n'.join(ans))


t = int(input())

def Myfunction(a, b):
	count = 0
	if a == b:
		return 0
	else:
		if a < b:
			temp = b - a
			temp2 = temp // 10
			count = temp2
			temp3 = temp - int(temp2) * 10
			if temp3 < 10 and temp3 != 0:
				count += 1
		else:
			temp = a - b
			temp2 = temp // 10
			count = temp2
			temp3 = temp - int(temp2) * 10
			if temp3 < 10 and temp3 != 0:
				count += 1
		return count
while t != 0:
	(a, b) = map(int, input().split())
	print(Myfunction(a, b))
	t -= 1


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	p = abs(a - b)
	q = p // 10
	r = p % 10
	if r == 0:
		print(q)
	else:
		print(q + 1)


t = int(input())
while t > 0:
	(a, b) = [int(p) for p in input().split()]
	if a > b:
		if (a - b) % 10 == 0:
			res = (a - b) // 10
		else:
			res = (a - b) // 10 + 1
	elif b > a:
		if (b - a) % 10 == 0:
			res = (b - a) // 10
		else:
			res = (b - a) // 10 + 1
	else:
		res = 0
	print(res)
	t -= 1


from collections import defaultdict as dd
import sys
input = sys.stdin.readline
t = int(input())
while t:
	(n, m) = map(int, input().split())
	dif = abs(n - m)
	ans = dif // 10
	if dif % 10:
		ans += 1
	print(ans)
	t -= 1


n = int(input())
for i in range(n):
	(a, b) = map(int, input().split())
	v = abs(b - a)
	ans = v // 10
	if v % 10 > 0:
		ans += 1
	print(ans)


def main():
	T = eval(input())
	for cas in range(T):
		(a, b) = map(int, input().split())
		print('{}'.format((abs(a - b) + 9) // 10))
main()


for i in range(int(input())):
	(a, b) = list(map(int, input().split()))
	l = 0
	while True:
		if a == b:
			print(l)
			break
		if b > a and (b - a) % 10 != 0:
			l = (b - a) // 10 + 1
			print(l)
			break
		if b > a:
			l = (b - a) // 10
			print(l)
			break
		if a > b and (a - b) % 10 != 0:
			l = (a - b) // 10 + 1
			print(l)
			break
		else:
			l = (a - b) // 10
			print(l)
			break


import sys
import math
from math import *
from collections import Counter, defaultdict, deque
lip = lambda : list(map(int, input().split()))
ip = lambda : int(input())
sip = lambda : input().split()

def main():
	(a, b) = lip()
	num = abs(a - b)
	print(math.ceil(num / 10))
for i in range(ip()):
	main()


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	delta = abs(a - b)
	counter = 0
	while delta != 0:
		if delta >= 10:
			step = delta // 10
			delta = delta % 10
			counter += step
		else:
			step = delta % 10
			delta -= step
			counter += 1
	print(counter)


from sys import stdin

def r():
	return stdin.readline().strip()

def r_t(tp):
	return map(tp, r().strip().split())

def r_l(tp):
	return list(r_t(tp))

def main():
	c = int(r())
	for _ in range(c):
		(a, b) = r_t(int)
		(piv1, piv2) = (a, b)
		if a == b:
			print(0)
		else:
			(a, b) = (max(piv1, piv2), min(piv1, piv2))
			x = a - b
			x = str(a - b)
			if len(x) == 1:
				print(1)
			else:
				print(int(x[:-1]) + 1 * ((a - b) % 10 != 0))
main()


from sys import stdin, stdout

def main():
	t = int(stdin.readline())
	for _ in range(t):
		(a, b) = [int(i) for i in stdin.readline().split()]
		diff = abs(a - b)
		out = diff // 10
		if diff % 10 != 0:
			out += 1
		stdout.write('{0}\n'.format(out))
main()


import math

def yetAnotherTwoIntegersProblem(a: int, b: int) -> int:
	return math.ceil(abs(a - b) / 10)
test_cases = int(input())
for _ in range(test_cases):
	inputs = list(map(int, input().split(' ')))
	print(yetAnotherTwoIntegersProblem(inputs[0], inputs[1]))


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	else:
		som = 0
		if b > a:
			(a, b) = (b, a)
		som = som + (a - b) // 10
		if (a - b) % 10 == 0:
			print(som)
		else:
			print(som + 1)


import math
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	c = max(a, b)
	d = min(a, b)
	diff = c - d
	ans = math.ceil(diff / 10)
	print(ans)


a = int(input())
for i in range(a):
	st = str(input()).split(' ')
	print((abs(int(st[0]) - int(st[1])) + 9) // 10)


import math

def MinimumStepEquals(a, b):
	diff = abs(a - b)
	return math.ceil(diff / 10)
t = int(input())
while t > 0:
	(a, b) = map(int, input().split())
	print(MinimumStepEquals(a, b))
	t -= 1


import sys

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

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))
testCases = int(input())
while testCases != 0:
	(a, b) = get_ints()
	gobbldygook = abs(a - b)
	if gobbldygook % 10 == 0:
		print(int(gobbldygook / 10))
	else:
		print(int(gobbldygook / 10 + 1))
	testCases -= 1


import sys
from sys import stdin
import math

def iinput():
	return int(input())

def minput():
	return map(int, input().split())

def linput():
	return list(map(int, input().split()))

def fiinput():
	return int(stdin.readline())

def fminput():
	return map(int, stdin.readline().strip().split())

def flinput():
	return list(map(int, stdin.readline().strip().split()))
for _ in range(iinput()):
	(a, b) = minput()
	d = abs(a - b)
	print(math.ceil(d / 10))


t = int(input())
for i in range(t):
	(a, b) = sorted(map(int, input().split()))
	if a == b:
		print(0)
	elif (b - a) % 10 == 0:
		print((b - a) // 10)
	else:
		print((b - a) // 10 + 1)


t = int(input())
for q in range(t):
	ab = input().split(' ')
	a = int(ab[0])
	b = int(ab[1])
	k = 0
	dif = b - a if b - a > 0 else a - b
	(k, r) = (dif // 10, dif % 10)
	print(k + 1 if r != 0 else k)


n = int(input())
for _ in range(n):
	(left, right) = map(int, input().split())
	if left < right:
		a = left
		b = right
	else:
		b = left
		a = right
	c = abs(a - b)
	count = 0
	if c % 10 == 0:
		count = c // 10
	else:
		count = c // 10 + 1
	print(count)


import math as m
t = int(input())
while t > 0:
	a = list(map(int, input().split()))
	print(m.ceil((max(a) - min(a)) / 10))
	t -= 1


t = int(input())
for i in range(t):
	nums = [int(i) for i in input().split()]
	a = nums[0]
	b = nums[1]
	tries = max(a, b) - min(a, b)
	if tries % 10 == 0:
		print(tries // 10)
	else:
		print(tries // 10 + 1)


import sys, os
from io import BytesIO, IOBase
import collections, itertools, bisect, heapq, math, string
from decimal import *
BUFSIZE = 8192
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def main():
	t = int(input())
	for i in range(t):
		(a, b) = map(int, input().split())
		print(math.ceil(abs(a - b) / 10))
main()


import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 6)

def inp():
	return int(input())

def inps():
	return input().rstrip()

def inpl():
	return list(map(int, input().split()))

def _debug(obj):
	print(obj, file=sys.stderr)
n = inp()
for i in range(n):
	(a, b) = inpl()
	b = abs(a - b)
	syo = b // 10
	amari = b % 10
	amari = 1 if amari != 0 else 0
	print(syo + amari)


n = int(input())
for i in range(n):
	(l, m) = map(int, input().split())
	x = abs(l - m)
	y = x // 10
	if x % 10 != 0:
		print(y + 1)
	else:
		print(y)


t = int(input())
for i in range(t):
	(a, b) = list(map(int, input().split()))
	diff = abs(a - b)
	if diff % 10 == 0:
		move = diff // 10
	else:
		move = diff // 10 + 1
	print(move)


for _ in range(int(input())):
	(a, b) = list(map(int, input().split()))
	if b < a:
		(b, a) = (a, b)
	dif = b - a
	print(dif // 10 + int(dif % 10 >= 1))


t = int(input())
for i in range(t):
	(a, b) = tuple(map(int, input().split()))
	sub = abs(a - b)
	moves = sub // 10 + (1 if sub % 10 > 0 else 0)
	print(moves)


from math import ceil
t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	(s, m) = (max(a, b), min(a, b))
	print([0, ceil((s - m) / 10)][a != b])


t = int(input())
while t:
	t -= 1
	(a, b) = map(int, input().split())
	k = abs(a - b)
	i = 10
	cnt = 0
	while i:
		cnt += k // i
		k = k % i
		i -= 1
	print(cnt)


from sys import stdin
g = lambda : stdin.readline().strip()
gl = lambda : g().split()
gil = lambda : [int(var) for var in gl()]
gfl = lambda : [float(var) for var in gl()]
gcl = lambda : list(g())
gbs = lambda : [int(var) for var in g()]
mod = int(1000000000.0) + 7
inf = float('inf')
(t,) = gil()
for _ in range(t):
	(a, b) = gil()
	d = abs(a - b)
	ans = d // 10 + (1 if d % 10 else 0)
	print(ans)


def solve():
	(a, b) = map(int, input().split())
	count = 0
	(a, b) = (max(a, b), min(a, b))
	if a % 10 > b % 10:
		count += 1
	count += a // 10 - b // 10
	print(count)
t = int(input())
for x in range(t):
	solve()


import math
from collections import defaultdict
for _ in range(int(input())):
	(a, b) = list(map(int, input().split()))
	k = abs(a - b)
	kk = k % 10
	if kk == 0:
		print(k // 10)
	else:
		print(k // 10 + 1)


for _ in range(int(input())):
	(a, b) = list(map(int, input().split()))
	ans = 0
	while a != b:
		if a > b:
			if a - b > 10:
				times = (a - b) // 10
				a = a - 10 * times
				ans += times
			else:
				a -= a - b
				ans += 1
		elif b - a > 10:
			times = (b - a) // 10
			a = a + 10 * times
			ans += times
		else:
			a += b - a
			ans += 1
	print(ans)


import math as m
for _ in range(int(input())):
	(x, y) = map(int, input().split())
	print(m.ceil(abs(x - y) / 10))


import math
case = int(input())
for i in range(0, case):
	(x, y) = [int(x) for x in input().split()]
	print(math.ceil(abs(y - x) / 10))


n = int(input())
for i in range(n):
	(a, b) = [int(i) for i in input().split()]
	if a == b:
		print(0)
	elif a > b:
		e = a - b
		if e <= 10:
			print(1)
		else:
			c = e // 10
			if e % 10 == 0:
				print(c)
			else:
				print(c + 1)
	else:
		e = b - a
		if e <= 10:
			print(1)
		else:
			c = e // 10
			if e % 10 == 0:
				print(c)
			else:
				print(c + 1)


t = int(input())
for i in range(t):
	l = list(map(int, input().split()))
	if l[0] > l[1]:
		c = l[0] - l[1]
	else:
		c = l[1] - l[0]
	d = c % 10
	c = c // 10
	if d > 0:
		c = c + 1
	print(c)


n = int(input())
s = [list(map(int, input().split())) for i in range(n)]
for v in s:
	t = abs(v[1] - v[0])
	ans = t // 10
	if t % 10 != 0:
		ans += 1
	print(ans)


import sys, collections
tc = int(sys.stdin.readline())
for _ in range(tc):
	(a, b) = map(int, sys.stdin.readline().split())
	if abs(a - b) % 10 != 0:
		print(abs(a - b) // 10 + 1)
	else:
		print(abs(a - b) // 10)


from sys import stdin
import math

def input():
	return stdin.readline().rstrip()
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	print(math.ceil(abs(b - a) / 10))


c = []
for i in range(int(input())):
	(a, b) = list(map(int, input().split()))
	d = abs(b - a)
	if d % 10 != 0:
		c.append(d // 10 + 1)
	else:
		c.append(d // 10)
for i in c:
	print(i)


a = int(input())
b = 0
while b < a:
	e = input().split(' ')
	c = int(e[0])
	d = int(e[1])
	if c == d:
		print(0)
	elif abs(c - d) % 10 == 0:
		print(abs(c - d) // 10)
	else:
		print(abs(c - d) // 10 + 1)
	b = b + 1


def solve(a, b):
	if a == b:
		res = 0
	elif abs(a - b) <= 10:
		res = 1
	else:
		res = abs(a - b) // 10
		if abs(a - b) % 10 > 0:
			res += 1
	print(res)
t = int(input())
for _ in range(t):
	inp = input().split()
	(a, b) = (int(inp[0]), int(inp[1]))
	solve(a, b)


(N,) = map(int, input().split())
for _ in range(N):
	(a, b) = map(int, input().split())
	print(-(-abs(b - a) // 10))


t = int(input())
for hh in range(0, t):
	(a, b) = [int(x) for x in input().split()]
	if a == b:
		ans = 0
	else:
		diff = abs(b - a)
		mx = diff // 10
		ans = diff // 10
		rem = diff - mx * 10
		if rem > 0:
			ans += 1
	print(ans)


from __future__ import division, print_function
import os
import sys
import math
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def main():
	t = int(input())
	for _ in range(t):
		(a, b) = map(int, input().split())
		print(int(math.ceil(abs(b - a) / 10)))
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


from sys import stdin, stdout
t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	if a > b:
		(a, b) = (b, a)
	var = b - a
	if var % 10 == 0:
		print(var // 10)
	else:
		var = var // 10
		print(var + 1)


import sys
input = sys.stdin.readline
t = int(input())
while t != 0:
	t -= 1
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
		continue
	cnt = abs(b - a) // 10
	if abs(b - a) % 10 == 0:
		print(cnt)
		continue
	print(cnt + 1)


t = input()
t = int(t)
ans = []
for i in range(t):
	x = input().split()
	x = list(map(int, x))
	if (x[0] - x[1]) % 10 == 0:
		ans.append(abs(x[0] - x[1]) // 10)
	else:
		ans.append(abs(x[0] - x[1]) // 10 + 1)
for i in ans:
	print(i)


T = int(input())
while T > 0:
	inp = input().split()
	a = int(inp[0])
	b = int(inp[1])
	diff = abs(a - b)
	if diff % 10 == 0:
		print(diff // 10)
	else:
		print(diff // 10 + 1)
	T -= 1


t = int(input())
l = [i for i in range(1, 11)]
for i in range(t):
	count = 0
	(a, b) = map(int, input().split(' '))
	if a > b:
		while a != b:
			c = a - b
			if c in l:
				count += 1
				a -= c
			else:
				d = c // 10
				count += d
				a -= 10 * d
	elif b > a:
		while a != b:
			c = b - a
			if c in l:
				count += 1
				a += c
			else:
				d = c // 10
				count += d
				a += 10 * d
	print(count)


from math import *
from bisect import *
from collections import *
from decimal import *

def inp():
	return int(input())

def st():
	return input().rstrip('\n')

def lis():
	return list(map(int, input().split()))

def ma():
	return map(int, input().split())
t = inp()
while t:
	t -= 1
	(n, m) = ma()
	z = abs(n - m)
	r = z // 10
	if z % 10:
		r += 1
	print(r)


t = int(input())
for i in range(t):
	inp = input().split()
	(a, b) = (int(inp[0]), int(inp[1]))
	res = abs(a - b)
	ans = res // 10
	if res % 10 > 0:
		ans += 1
	print(ans)


n = int(input())

def solve(a, b):
	if abs(a - b) % 10 == 0:
		return abs(a - b) // 10
	else:
		return abs(a - b) // 10 + 1
for i in range(n):
	(a, b) = map(int, input().split(' '))
	print(solve(a, b))


def ans(a, b):
	temp = abs(b - a)
	cnt = temp // 10
	if temp % 10:
		cnt += 1
	return cnt
t = int(input())
for _ in range(t):
	ab = list(map(int, input().strip().split()))
	print(ans(ab[0], ab[1]))


t = int(input())
for case in range(t):
	(a, b) = list(map(int, input().split()))
	diff = abs(a - b)
	print((diff + 9) // 10)


t = int(input())
for __ in range(t):
	(a, b) = map(int, input().split(' '))
	if a > b:
		n = (a - b) // 10
		if (a - b) % 10 > 0:
			n += 1
		print(n)
	elif b > a:
		n = (b - a) // 10
		if (b - a) % 10 > 0:
			n += 1
		print(n)
	else:
		print(0)


T = int(input())
for i in range(T):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	elif a > b:
		count = 0
		x = a - b
		if x <= 10:
			count += 1
			print(count)
		else:
			c = x // 10
			c1 = x % 10
			count += c
			if c1 != 0:
				count += 1
			print(count)
	else:
		x = b - a
		count = 0
		if x <= 10:
			count += 1
			print(count)
		else:
			c = x // 10
			count += c
			c1 = x % 10
			if c1 != 0:
				count += 1
			print(count)


for i in range(int(input())):
	x = input().strip().split()
	x1 = int(x[0])
	x2 = int(x[1])
	ans = abs(x2 - x1) // 10
	if abs(x2 - x1) % 10 != 0:
		ans += 1
	if x2 != x1:
		print(ans)
	else:
		print(0)


def solve(n, k):
	diff = abs(n - k)
	if diff % 10 == 0:
		print(diff // 10)
	else:
		print(diff // 10 + 1)
t = int(input())
for i in range(t):
	a = list(map(int, input().split()))
	solve(a[0], a[1])


def sub(a, b):
	count = 0
	t = 10
	k = (a - b) // 10 * 10
	a = a - k
	count += k // 10
	while a != b:
		t = min(abs(a - b), t)
		a = a - t
		count += 1
	return count

def add(a, b):
	count = 0
	t = 10
	k = (b - a) // 10 * 10
	a = a + k
	count += k // 10
	while a != b:
		t = min(b - a, t)
		a = a + t
		count += 1
	return count
t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	gap = a - b
	if gap == 0:
		print(0)
	if gap > 0:
		print(sub(a, b))
	if gap < 0:
		print(add(a, b))


def i_len(a, b):
	j = 0
	for i in str(b - a):
		j += 1
	return int(j)

def chislo(a, b, count, abc):
	if a > b:
		(a, b) = (b, a)
	if a < b:
		abc = (b - a) % 10
		count += (b - a) // 10
		if abc in range(1, 10):
			count += 1
			return count
		else:
			return count
	else:
		return count
_list = []
n = int(input())
for i in range(0, n):
	(a, b) = input().split(' ', 1)
	count = 0
	abc = 0
	_list.append(chislo(int(a), int(b), count, abc))
for i in _list:
	print(i)


number_of_tests = int(input())
for i in range(number_of_tests):
	(a, b) = [int(i) for i in input().split()]
	output = 0
	output += abs(a - b) // 10
	if abs(a - b) % 10 > 0:
		output += 1
	else:
		pass
	print(output)


t = int(input())
for i in range(0, t):
	(a, b) = map(int, input().split())
	ans = (abs(a - b) + 9) // 10
	print(ans)


a = []
t = int(input())
for i in range(t):
	l = list(input().split(' '))
	l = [int(i) for i in l]
	result = abs(l[1] - l[0]) // 10
	if (l[1] - l[0]) % 10 == 0:
		a.append(result)
	else:
		a.append(result + 1)
for i in a:
	print(i)


def find(a, b):
	if a == b:
		return 0
	else:
		ans = abs(a - b)
		f = int(ans // 10)
		if ans % 10 != 0:
			return f + 1
		return f
t = int(input())
for tt in range(t):
	(a, b) = map(int, input().split())
	print(find(a, b))


for _ in range(int(input())):
	(a, b) = sorted(list(map(int, input().strip().split(' '))))
	if (b - a) % 10 != 0:
		print((b - a) // 10 + 1)
	else:
		print((b - a) // 10)


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for pp in range(t):
		solve(pp)

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def google(p):
	print('Case #' + str(p) + ': ', end='')

def lcm(a, b):
	return a * b // gcd(a, b)

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def solve(case):
	(a, b) = sep()
	(a, b) = (min(a, b), max(a, b))
	rem = b - a
	ans = ceil(rem / 10)
	print(ans)
testcase(int(inp()))


import math
t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	x = abs(a - b)
	r = math.ceil(x / 10)
	print(r)


ANS = []

def solve():
	(a, b) = map(int, input().split())
	d = int(max(a - b, b - a))
	ANS.append(int((d + 9) / 10))
q = int(input())
while q > 0:
	q -= 1
	solve()
for x in ANS:
	print(x)


t = int(input())
while t:
	(a1, b1) = map(int, input().split())
	a = min(a1, b1)
	b = max(a1, b1)
	cnt = (b - a) // 10
	if (b - a) % 10 != 0:
		cnt += 1
	print(cnt)
	t -= 1


from functools import reduce
import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def arr():
	return [int(i) for i in input().split()]

def sarr():
	return [int(i) for i in input()]

def starr():
	return [str(x) for x in input().split()]

def inn():
	return int(input())

def svalue():
	return tuple(map(str, input().split()))

def parr():
	return [value() for i in range(n)]
mo = 1000000007
for _ in range(inn()):
	(n, m) = value()
	res = abs(n - m)
	ans = res // 10
	if res % 10 != 0:
		ans += 1
	print(ans)


import math
t = int(input())
for i in range(t):
	(a, b) = [int(i) for i in input().split()]
	print(math.ceil(math.fabs(b - a) / 10))


def main():
	t = Iint()
	for _ in range(t):
		(a, b) = Imap()
		k = abs(a - b)
		(k1, k2) = (k // 10, k % 10)
		if k2:
			k1 += 1
		print(k1)
FIO = 10

def I():
	return input()

def Iint():
	return int(input())

def Ilist():
	return list(map(int, input().split()))

def Imap():
	return map(int, input().split())

def Plist(li, s=' '):
	print(s.join(map(str, li)))
en = enumerate

def log(*args):
	print('\x1b[36m', *args, '\x1b[0m', file=sys.stderr)
	return
if FIO:
	from io import BytesIO, IOBase
	import sys
	import os
elif __name__ == '__main__':
	main()
	exit()
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')
main()


def func(a, b):
	first = abs(a - b)
	c = first // 10
	if first % 10 != 0:
		c += 1
	print(c)
	return
t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	func(a, b)


import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
from math import ceil

def main():
	t = int(input())
	for _ in range(t):
		(a, b) = map(int, input().split())
		if a == b:
			print(0)
		else:
			ab = b - a
			if ab > 0:
				r = ceil((b - a) / 10)
			else:
				r = ceil((a - b) / 10)
			print(r)
main()


t = int(input())
for i in range(t):
	(a, b) = [int(s) for s in input().split()]
	print(abs(b - a) // 10 + int(abs(b - a) % 10 != 0))


for t in range(int(input())):
	(a, b) = map(int, input().split(' '))
	if a > b:
		(a, b) = (b, a)
	diff = b - a
	ans = 0
	for i in range(10, 0, -1):
		ans += diff // i
		diff = diff % i
	print(ans)


def count_operations(a, b):
	difference = b - a
	if difference == 0:
		return 0
	if difference % 10 == 0:
		return abs(int(difference / 10))
	else:
		return abs(int(difference / 10)) + 1
t = int(input())
data = []
for i in range(t):
	(a, b) = input().split()
	data.append((int(a), int(b)))
for values in data:
	print(count_operations(values[0], values[1]))


for i in range(int(input())):
	(first, second) = map(int, input().split())
	if first == second:
		print(0)
	else:
		print((max(first, second) - min(first, second) + 9) // 10)


import sys
input = sys.stdin.readline
from collections import defaultdict
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if a > b:
		(a, b) = (b, a)
	c = b - a
	x = c // 10
	y = c - x * 10
	print(x + min(y, 1))


for i in range(int(input())):
	(a, b) = map(int, input().split())
	if a > b:
		move = -((b - a) // 10)
	elif b > a:
		move = -((a - b) // 10)
	else:
		move = 0
	print(move)


from sys import stdin, stdout

def calculate(a, b):
	diff = abs(b - a)
	if diff % 10 == 0:
		return str(int(diff / 10))
	else:
		return str(int(diff / 10) + 1)
sollist = []
solution = []
N = int(stdin.readline())
for i in range(N):
	buffer = stdin.readline()
	a = int(buffer.split()[0])
	b = int(buffer.split()[1])
	sollist.append([a, b])
for i in range(N):
	work = sollist[i]
	print(calculate(work[0], work[1]))


t = int(input())
for h in range(t):
	(a, b) = map(int, input().split())
	c = abs(a - b)
	ans = c // 10 + int(c % 10 != 0)
	print(ans)


def solve(a, b):
	if a > b:
		(a, b) = (b, a)
	diff = b - a
	n = diff // 10
	if diff % 10 != 0:
		n += 1
	return n
t = int(input())
for i in range(t):
	(a, b) = (int(x) for x in input().split())
	print(solve(a, b))


import io, os
inp = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
inar = lambda : list(map(int, inp().split()))
inin = lambda : int(inp())
inst = lambda : inp().decode().strip()
_T_ = inin()
for _t_ in range(_T_):
	(a, b) = inar()
	print(int(abs(a - b) / 10 + 0.9))


import sys

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

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

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))
mod = int(1000000000.0) + 7
for _ in range(iinput()):
	(a, b) = rinput()
	diff = abs(b - a)
	if diff % 10 == 0:
		print(diff // 10)
	else:
		print(diff // 10 + 1)


Testcase = int(input())
for i in range(Testcase):
	Moves = 0
	Inputs = list(map(int, input().split()))
	a = Inputs[0]
	b = Inputs[1]
	Temp = abs(b - a)
	Moves = Temp // 10
	Temp -= Moves * 10
	while Temp != 0:
		Temp = 0 if Temp < 11 else Temp - 10
		Moves += 1
	print(Moves)


def solve(a, b):
	diff = abs(a - b)
	return (diff + 10 - 1) // 10
t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	print(solve(a, b))


for _ in range(int(input())):
	(m, n) = map(int, input().split())
	if m == n:
		print('0')
	else:
		maxi = max(m, n)
		mini = min(m, n)
		res = maxi - mini
		q = res // 10
		rem = res % 10
		print(q) if rem == 0 else print(q + 1)


def way(a, b):
	diff = a - b
	count = 0
	for k in range(1, 11):
		way = diff // (11 - k)
		count += way
		diff = diff - diff // (11 - k) * (11 - k)
	print(count)
t = int(input())
for case in range(t):
	(a, b) = map(int, input().split(' '))
	if a >= b:
		way(a, b)
	else:
		way(b, a)


t = int(input())
ans = []
while t > 0:
	(a, b) = map(int, input().split())
	t -= 1
	k = n = 0
	if a == b:
		ans.append(0)
	if a > b:
		if a - b > 10:
			n = (a - b) // 10
			k += n
			if (a - b) % 10 == 0:
				ans.append(k)
			else:
				ans.append(k + 1)
		else:
			ans.append(1)
	if a < b:
		if b - a > 10:
			n = (b - a) // 10
			k += n
			if (b - a) % 10 == 0:
				ans.append(k)
			else:
				ans.append(k + 1)
		else:
			ans.append(1)
for i in ans:
	print(i)


import sys, threading
from collections import defaultdict, Counter
input = sys.stdin.readline

def rl(type):
	return [type(w) for w in input().split()]

def reverse(arr):
	return arr[-1::-1]

def mod(a, m):
	return (a % m + m) % m

def create_graph(n):
	graph = {}
	for _ in range(n):
		(x, y) = map(int, input().split())
		graph[x].append(y)
		graph[y].append(x)
	return graph

def main():
	for _ in range(int(input())):
		(a, b) = map(int, input().split())
		temp = abs(a - b)
		result = temp // 10 + (1 if temp % 10 else 0)
		print(result)
sys.setrecursionlimit(10 ** 6)
threading.stack_size(10 ** 8)
t = threading.Thread(target=main)
t.start()
t.join()


n = int(input())
arr = []
cnt = []
for i in range(n):
	temp_str = input()
	fin = [int(temp_str.split(' ')[0]), int(temp_str.split(' ')[1])]
	arr.append(fin)
for i in range(n):
	move_a = abs(arr[i][0] - arr[i][1]) / 10
	if move_a > int(move_a):
		cnt.append(int(move_a) + 1)
	else:
		cnt.append(int(move_a))
for i in range(n):
	print(cnt[i])


n = int(input())
s = [list(map(int, input().split())) for i in range(n)]
for l in s:
	t = abs(l[1] - l[0])
	resp = t // 10
	if t % 10 != 0:
		resp += 1
	print(resp)


t = int(input())
output = []
for i in range(t):
	a = list(map(int, input().split()))
	if abs(int(a[0] - a[1])) % 10 == 0:
		output.append(abs(int((a[0] - a[1]) / 10)))
	else:
		output.append(abs(int((a[0] - a[1]) / 10)) + 1)
for i in output:
	print(i)


from math import ceil
t = int(input())
while t:
	(a, b) = [int(i) for i in input().split()]
	x = abs(a - b)
	print(ceil(x / 10))
	t -= 1


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	print((max(a, b) - min(a, b) + 9) // 10)


lask = int(input())
for i in range(lask):
	s = input().split(' ')
	s = [int(x) for x in s]
	sum1 = (abs(s[0] - s[1]) + 10 - 1) // 10
	print(sum1)


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
sys.setrecursionlimit(100000000)
ii = lambda : int(input())
si = lambda : input()
jn = lambda x, l: x.join(map(str, l))
sl = lambda : list(map(str, input().strip()))
mi = lambda : map(int, input().split())
mif = lambda : map(float, input().split())
lii = lambda : list(map(int, input().split()))
ceil = lambda x: int(x) if x == int(x) else int(x) + 1
ceildiv = lambda x, d: x // d if x % d == 0 else x // d + 1
flush = lambda : stdout.flush()
stdstr = lambda : stdin.readline()
stdint = lambda : int(stdin.readline())
stdpr = lambda x: stdout.write(str(x))
mod = 1000000007
for _ in range(ii()):
	(a, b) = mi()
	x = b - a
	sol = abs(x) // 10
	if abs(x) % 10 == 0:
		print(sol)
	else:
		print(sol + 1)


def twoIntProb(a, b):
	if a > b:
		n = a - b
	elif a == b:
		return 0
	elif a < b:
		n = b - a
	store = 0
	while n > 0:
		if n >= 10:
			store = store + n // 10
			n = n % 10
		else:
			store = store + 1
			n = n % 10
			break
	return store
t = int(input())
while t > 0:
	store = input()
	(a, b) = store.split(' ')
	a = int(a)
	b = int(b)
	print(twoIntProb(a, b))
	t = t - 1


n = int(input())
langs = {'po': 'FILIPINO', 'desu': 'JAPANESE', 'masu': 'JAPANESE', 'mnida': 'KOREAN'}
res = []
for i in range(n):
	(a, b) = list(map(lambda x: int(x), input().split()))
	dif = a - b
	ans = abs(dif) / 10
	if ans > int(ans):
		ans = int(ans) + 1
	res.append(int(ans))
for w in res:
	print(w)


z = int(input())
i = 0
while i < z:
	(a, b) = map(int, input().split())
	s = max(a, b) - min(a, b)
	if s != 0:
		d = (s + 9) // 10
	else:
		d = 0
	print(d)
	i += 1


for _ in range(int(input())):
	[a, b] = [int(i) for i in input().split()]
	x = b - a
	n = 10
	count = 0
	neg = False
	if x < 0:
		neg = True
		x = x * -1
	while x != 0 and n != 0:
		if x >= n:
			count += int(x / n)
			break
		else:
			n -= 1
	if x % n == 0:
		print(count)
	else:
		print(count + 1)


TC = int(input())
for tc in range(TC):
	(A, B) = map(int, input().split())
	result = -1
	if A > B:
		(a, b) = divmod(A - B, 10)
		result = a
		if b > 0:
			result += 1
	else:
		(a, b) = divmod(B - A, 10)
		result = a
		if b > 0:
			result += 1
	print(result)


import math

def read_int() -> int:
	return int(input())

def read_ints():
	return map(int, input().split(' '))

def test_case():
	(a, b) = read_ints()
	if a >= b:
		print(math.ceil((a - b) / 10))
	else:
		print(math.ceil((b - a) / 10))
tests = read_int()
for _ in range(tests):
	test_case()


N = int(input())
x = [list(map(int, input().split())) for _ in range(N)]
for i in range(N):
	ans = -(-abs(x[i][1] - x[i][0]) // 10)
	print(ans)


import sys, math
import io, os
from bisect import bisect_left as bl, bisect_right as br, insort
from heapq import heapify, heappush, heappop
from collections import defaultdict as dd, deque, Counter

def data():
	return sys.stdin.readline().strip()

def mdata():
	return list(map(int, data().split()))

def outl(var):
	sys.stdout.write('\n'.join(map(str, var)) + '\n')

def out(var):
	sys.stdout.write(str(var) + '\n')
from decimal import Decimal
mod = int(1000000000.0) + 7
INF = 2 ** 32
for t in range(int(data())):
	(a, b) = mdata()
	ans = 0
	if abs(a - b) % 10 != 0:
		ans = 1
	out(abs(a - b) // 10 + ans)


import sys
import math
import itertools
import functools
import collections
import operator
import fileinput
import copy
ORDA = 97

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return [int(i) for i in input().split()]

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

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=2):
	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 divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

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):
	new_number = 0
	while number > 0:
		new_number += number % base
		number //= base
	return new_number

def cdiv(n, k):
	return n // k + (n % k != 0)

def ispal(s):
	for i in range(len(s) // 2 + 1):
		if s[i] != s[-i - 1]:
			return False
	return True

def main():
	for i in range(ii()):
		(a, b) = mi()
		if a < b:
			(a, b) = (b, a)
		c = (a - b) // 10
		if (a - b) % 10 != 0:
			print(c + 1)
		else:
			print(c)
main()


test_cases = int(input())
for case in range(test_cases):
	(a, b) = map(int, input().split())
	if a == b:
		print('0')
	elif abs(a - b) <= 10:
		print('1')
	else:
		moves = abs(a - b) / 10
		remainder = abs(a - b) % 10
		if remainder == 0:
			print('%d' % moves)
		else:
			moves += 1
			print('%d' % moves)


import sys
import math
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

class Solution:

	def main(self, a, b):
		df = abs(a - b)
		return math.ceil(df / 10)
t = inp()
Solution = Solution()
for _ in range(t):
	(a, b) = inlt()
	res = Solution.main(a, b)
	print(res)


t = int(input())
for _ in range(t):
	(a, b) = list(map(int, input().split()))
	d = abs(b - a)
	dm = d % 10
	d -= dm
	ans = d // 10
	if dm > 0:
		ans += 1
	print(ans)


t = int(input())
for i in range(t):
	a = []
	a = [int(a) for a in input().split()]
	x = max(a)
	y = min(a)
	count = 0
	if x - y == 0:
		print('0')
	else:
		count = (x - y) // 10
		if x - count * 10 - y <= 9 and x - count * 10 - y > 0:
			count = count + 1
		print(count)


def iin():
	return int(input())

def lin():
	return list(map(int, input().split()))

def main():
	t = iin()
	while t:
		t -= 1
		(a, b) = lin()
		print((abs(a - b) + 9) // 10)
main()


t = int(input())
for i in range(t):
	(a, b) = [int(j) for j in input().split()]
	diff = abs(a - b)
	ans = diff / 10
	if diff % 10:
		ans += 1
	print(int(ans))


out = []
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	c = a - b if a >= b else b - a
	out.append(str((c + 9) // 10))
print('\n'.join(out))


import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 6)
for _ in range(int(input().rstrip())):
	(a, b) = map(int, input().split())
	t = abs(a - b)
	if t >= 10:
		if t % 10:
			print(t // 10 + 1)
		else:
			print(t // 10)
	elif a != b:
		print(1)
	else:
		print(0)


import math
for t in range(int(input())):
	(a, b) = input().split()
	(a, b) = (int(a), int(b))
	sub = abs(a - b)
	ans = math.ceil(sub / 10)
	print(ans)


from copy import copy

def get_int():
	return int(input())

def get_ints():
	return [int(item) for item in input().split(' ')]

def get_str():
	return input()

def get_strs():
	return input().split(' ')

def main():
	t = get_int()
	for _ in range(t):
		(a, b) = get_ints()
		(res1, res2) = (abs(a - b) / 10, abs(a - b) // 10)
		print(res2 if res1 == res2 else res2 + 1)
main()


n = int(input())
tests = [input() for _ in range(n)]
for test in tests:
	(a, b) = [int(x) for x in test.split(' ')]
	count = 0
	while True:
		if a == b:
			print(count)
			break
		else:
			diff = a - b
			tens = abs(diff / 10)
			if tens.is_integer():
				count += tens
			else:
				count += int(tens) + 1
			print(int(count))
			break


T = int(input())
for _ in range(T):
	(a, b) = [int(x) for x in input().split(' ')]
	diff = abs(a - b)
	print(diff // 10 + (diff % 10 != 0))


n = int(input())
for i in range(n):
	a = list(map(int, input().split(' ')))
	d = abs(a[1] - a[0])
	c1 = 0
	c = d / 10
	sum = 0
	e = d // 10
	x = d - 10 * e
	if d == 0:
		print(0)
	else:
		i = 10
		while i >= 1:
			if c > 0:
				sum = x - i
				if sum >= 0:
					c1 += 1
					x = sum
			if c < 0:
				sum = d - i
				c1 += 1
			if sum == 0 or d == 0:
				break
			i -= 1
		print(c1 + e)


for test in range(0, int(input())):
	arr = [int(x) for x in input().split()]
	(a, b) = (arr[0], arr[1])
	if ((b - a) / 10).is_integer():
		print(abs(b - a) // 10)
	else:
		print(abs(b - a) // 10 + 1)


def input_int():
	return int(input())

def input_int_list():
	return list(map(int, input().split()))

def input_int_map():
	return map(int, input().split())

def run():
	q_num = input_int()
	for i in range(q_num):
		(a, b) = input_int_map()
		diff = max(a, b) - min(a, b)
		diff_count = diff // 10
		if diff % 10 > 0:
			diff_count += 1
		print(diff_count)
run()


import sys
import math
import collections
import operator as op
from collections import deque
from math import gcd, inf, sqrt, pi, cos, sin, ceil, log2
from bisect import bisect_right, bisect_left
from functools import reduce
from sys import stdin, stdout, setrecursionlimit
setrecursionlimit(2 ** 20)

def factorial(n):
	if n == 0:
		return 1
	return n * factorial(n - 1)

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer // denom

def prime_factors(n):
	i = 2
	factors = []
	while i * i <= n:
		if n % i:
			i += 1
		else:
			n //= i
			factors.append(i)
	if n > 1:
		factors.append(n)
	return list(factors)

def sumDigits(no):
	return 0 if no == 0 else int(no % 10) + sumDigits(int(no / 10))
MOD = 1000000007
PMOD = 998244353
N = 10 ** 5
T = 1
T = int(stdin.readline())
for _ in range(T):
	(a, b) = list(map(int, stdin.readline().rstrip().split()))
	ans = abs(a - b)
	if ans % 10 == 0:
		print(ans // 10)
	else:
		print(ans // 10 + 1)


import math
from decimal import Decimal
import heapq
import copy
import heapq
from collections import deque
from collections import defaultdict
MOD = 1000000007

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) = map(int, input().split())
	return (n, m)

def da():
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	return (n, m, a)

def dva():
	(n, m) = 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(n):
	tc = []
	ans = {}
	d = 2
	while d * d <= n:
		if n % d == 0:
			tc.append(d)
			n //= d
		else:
			d += 1
	if n > 1:
		tc.append(n)
	for i in tc:
		ans[i] = ans.get(i, 0) + 1
	return ans

def to_zero(n, s):
	lst = s[0]
	ans = []
	for i in range(n):
		if lst == s[i]:
			continue
		elif lst == '0':
			lst = '1'
			ans.append(i)
		else:
			lst = '0'
			ans.append(i)
	if lst == '1':
		ans.append(n)
	return ans
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if a > b:
		(a, b) = (b, a)
	k = 0
	b -= a
	while b > 0:
		for i in range(10, 0, -1):
			if b >= i:
				d = b // i
				k += d
				b -= d * i
				break
	print(k)


t = int(input())
for each in range(t):
	(a, b) = map(int, input().split())
	res = 0
	dif = abs(a - b)
	if dif % 10 == 0:
		print(dif // 10)
	else:
		print(dif // 10 + 1)


T = int(input())
for i in range(T):
	(a, b) = map(int, input().split())
	if a <= b:
		if (b - a) % 10 != 0:
			ans = (b - a) // 10 + 1
		else:
			ans = (b - a) // 10
	elif (a - b) % 10 != 0:
		ans = (a - b) // 10 + 1
	else:
		ans = (a - b) // 10
	print(ans)


def solve(x: int, y: int) -> int:
	diff = abs(y - x)
	if diff % 10 == 0:
		return diff // 10
	return diff // 10 + 1
t = int(input())
while t:
	(a, b) = map(int, input().split(' '))
	print(solve(a, b))
	t -= 1


amount = int(input())
for _ in range(amount):
	nums = [*map(int, input().split())]
	goal = max(nums) - min(nums)
	times = 0
	for i in range(10, 0, -1):
		times += goal // i
		goal %= i
	print(times)


import sys, math
try:
	(sys.stdin, sys.stdout) = (open('input.txt', 'r'), open('out.txt', 'w'))
except:
	pass
from sys import stdin, stdout
mod = int(1000000000.0 + 7)
from statistics import mode
from collections import *
from math import ceil, floor, inf, factorial, gcd, log2, sqrt, log
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()

def lcm(a, b):
	return a * b // gcd(a, b)

def setbits(n):
	return bin(n).count('1')

def resetbits(n):
	return bin(n).count('0')

def modinv(n, p):
	return pow(n, p - 2, p)

def ncr(n, r):
	(num, den) = (1, 1)
	r = min(n, n - r)
	for i in range(r):
		num *= n - i
		den *= i + 1
	return num // den

def ncr_p(n, r, p):
	(num, den) = (1, 1)
	r = min(r, n - r)
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * modinv(den, p) % p

def isPrime(num):
	if num <= 1:
		return False
	if num == 2 or n == 3:
		return True
	if num % 2 == 0 or num % 3 == 0:
		return False
	m = int(num ** 0.5) + 1
	for i in range(5, m, 6):
		if num % i == 0 or num % (i + 2) == 0:
			return False
	return True

def bin_search(s, low, high, val):
	while low <= high:
		mid = low + (high - low) // 2
		if s[mid] == val:
			return mid
		elif s[mid] < val:
			low = mid + 1
		else:
			high = mid - 1
	return -1

def sumofdigit(num):
	count = 0
	while num:
		count += num % 10
		num //= 10
	return count

def inputmatrix():
	(r, c) = iia()
	mat = [0] * r
	for i in range(r):
		mat[i] = iia()
	return (r, c, mat)

def prefix_sum(n, s):
	for i in range(1, n):
		s[i] += s[i - 1]
	return s

def binomial(n, k):
	if 0 <= k <= n:
		ntok = 1
		ktok = 1
		for t in range(1, min(k, n - k) + 1):
			ntok *= n
			ktok *= t
			n -= 1
		return ntok // ktok
	else:
		return 0

def divisors(n):
	res = []
	for i in range(1, ceil(sqrt(n)) + 1):
		if n % i == 0:
			if i == n // i:
				res.append(i)
			else:
				res.append(i)
				res.append(n // i)
	return res
for _ in range(ii1()):
	(a, b) = iia()
	if a == b:
		print(0)
	elif abs(b - a) <= 10:
		print(1)
	else:
		ans = abs(a - b) // 10
		if abs(a - b) % 10 == 0:
			print(ans)
		else:
			print(ans + 1)


import sys
import os
import math
import copy
from math import gcd
from bisect import bisect
from io import BytesIO, IOBase
from math import sqrt, floor, factorial, gcd, log, ceil
from collections import deque, Counter, defaultdict
from itertools import permutations, combinations
from itertools import accumulate

def Int():
	return int(sys.stdin.readline())

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

def Lstr():
	return list(sys.stdin.readline().strip())

def Str():
	return sys.stdin.readline().strip()

def Mstr():
	return map(str, sys.stdin.readline().strip().split())

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

def Hash():
	return dict()

def Mod():
	return 1000000007

def Ncr(n, r, p):
	return fact[n] * (ifact[r] * ifact[n - r] % p) % p

def Most_frequent(list):
	return max(set(list), key=list.count)

def Mat2x2(n):
	return [List() for _ in range(n)]

def Lcm(x, y):
	return x * y // gcd(x, y)

def dtob(n):
	return bin(n).replace('0b', '')

def btod(n):
	return int(n, 2)

def common(l1, l2):
	return set(l1).intersection(l2)

def solution():
	for _ in range(Int()):
		(a, b) = Mint()
		mi = min(a, b)
		ma = max(a, b)
		ans = ma - mi
		print(ceil(ans / 10))
solution()


import math
s = int(input())
for i in range(s):
	(a, b) = map(int, input().split())
	x = abs(a - b)
	print(math.ceil(x / 10))


n = int(input())
for _ in range(n):
	(a, b) = map(int, input().strip().split())
	c = abs(b - a) // 10
	print(c + int((b - a) % 10 != 0))


R = lambda : map(int, input().split())
(t,) = R()
for _ in range(t):
	(a, b) = R()
	x = abs(b - a)
	ans = x // 10
	if x % 10 != 0:
		ans += 1
	print(ans)


for i in range(int(input())):
	(x, y) = map(int, input().split(' '))
	if x < y:
		(x, y) = (y, x)
	count = 0
	count += (x - y) // 10
	if (x - y) % 10 != 0:
		count += 1
	print(count)


def up(n):
	if n == int(n):
		return int(n)
	return int(n + 1)
n = int(input())
for i in range(n):
	nkt = input().split()
	a = int(nkt[0])
	b = int(nkt[1])
	print(up(abs(b - a) / 10))


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	cnt = 0
	while a != b:
		if a > b:
			if a - b >= 10:
				cnt += (a - b) // 10
				a -= (a - b) // 10 * 10
			else:
				cnt += 1
				break
		elif b - a >= 10:
			cnt += (b - a) // 10
			a += (b - a) // 10 * 10
		else:
			cnt += 1
			break
	print(cnt)


def farr(s):
	all_freq = {}
	for i in s:
		if i in all_freq:
			all_freq[i] += 1
		else:
			all_freq[i] = 1
	return all_freq

def nextInt():
	return int(input())

def intArr():
	arr = input().split(' ')
	return [int(x) for x in arr]

def op(arr, l):
	arr.sort()
	d = arr[l - 1]
	for i in range(0, l):
		arr[i] = d - arr[i]
	return
t = nextInt()
ans = []
for tt in range(t):
	arr = intArr()
	n1 = arr[0]
	n2 = arr[1]
	if n1 == n2:
		ans.append(0)
	else:
		if n1 > n2:
			dif = n1 - n2
		else:
			dif = n2 - n1
		if dif % 10 == 0:
			ans.append(int(dif / 10))
		else:
			s = int(str(dif)[len(str(dif)) - 1])
			dif -= s
			ans.append(1 + int(dif / 10))
for x in ans:
	print(x)


t = int(input())
for i in range(t):
	(b, d) = map(int, input().split())
	if b == d:
		print(0)
	elif abs(b - d) % 10 >= 1:
		print(abs(b - d) // 10 + 1)
	else:
		print(abs(b - d) // 10)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	count = 0
	if n <= k:
		s = (k - n) // 10
		if (k - n) % 10 != 0:
			count = count + 1
		print(count + s)
	else:
		s = (n - k) // 10
		if (n - k) % 10 != 0:
			count = count + 1
		print(count + s)


n = int(input())
for i in range(n):
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	if b > a:
		d = b - a
		d = d / 10
		if d.is_integer():
			print(int(d))
		else:
			print(int(d + 1))
	elif a > b:
		d = a - b
		d = d / 10
		if d.is_integer():
			print(int(d))
		else:
			print(int(d + 1))
	elif a == b:
		print(0)


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	c = abs(a - b)
	ans = 0
	ans = c // 10
	c = c % 10
	ans = ans + c // 9
	c = c % 9
	ans = ans + c // 8
	c = c % 8
	ans = ans + c // 7
	c = c % 7
	ans = ans + c // 6
	c = c % 6
	ans = ans + c // 5
	c = c % 5
	ans = ans + c // 4
	c = c % 4
	ans = ans + c // 3
	c = c % 3
	ans = ans + c // 2
	c = c % 2
	ans = ans + c
	print(ans)


t = int(input())
for tc in range(t):
	(a, b) = map(int, input().split())
	if a > b:
		(a, b) = (b, a)
	c = 0
	e = 0
	c = (b - a) // 10
	a = a + 10 * c
	while b - a > 10:
		e += (b - a) // 10
		a = a + e * 10
		c = c + e
	if b - a == 0:
		print(c)
	else:
		print(c + 1)


from math import gcd
from bisect import bisect_left, bisect_right
from itertools import combinations
from itertools import permutations
from bisect import bisect_left
from math import ceil
from math import radians
from heapq import heapify, heappush, heappop
import bisect
from math import pi
from collections import deque
from math import factorial
from math import log, ceil
from collections import defaultdict
from math import *
from sys import stdin, stdout
import itertools
import os
import sys
import threading
from collections import deque, Counter, OrderedDict, defaultdict
from heapq import *
from fractions import Fraction
mod = int(pow(10, 9) + 7)

def ii():
	return int(input())

def si():
	return str(input())

def mi():
	return map(int, input().split())

def li1():
	return list(mi())

def fii():
	return int(stdin.readline())

def fsi():
	return str(stdin.readline())

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

def fli():
	return list(fmi())
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}

def getKey(item):
	return item[0]

def sort2(l):
	return sorted(l, key=getKey)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res
graph = defaultdict(list)
visited = [0] * 1000000
col = [-1] * 1000000

def bfs(d, v):
	q = []
	q.append(v)
	visited[v] = 1
	while len(q) != 0:
		x = q[0]
		q.pop(0)
		for i in d[x]:
			if visited[i] != 1:
				visited[i] = 1
				q.append(i)
		print(x)

def make_graph(e):
	d = {}
	for i in range(e):
		(x, y) = mi()
		if x not in d:
			d[x] = [y]
		else:
			d[x].append(y)
		if y not in d:
			d[y] = [x]
		else:
			d[y].append(x)
	return d

def gr2(n):
	d = defaultdict(list)
	for i in range(n):
		(x, y) = mi()
		d[x].append(y)
	return d

def connected_components(graph):
	seen = set()

	def dfs(v):
		vs = set([v])
		component = []
		while vs:
			v = vs.pop()
			seen.add(v)
			vs |= set(graph[v]) - seen
			component.append(v)
		return component
	ans = []
	for v in graph:
		if v not in seen:
			d = dfs(v)
			ans.append(d)
	return ans

def primeFactors(n):
	s = set()
	while n % 2 == 0:
		s.add(2)
		n = n // 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0 and i % 2 == 1:
			s.add(i)
			n = n // i
	if n > 2 and n % 2 == 1:
		s.add(n)
	return s

def find_all(a_str, sub):
	start = 0
	while True:
		start = a_str.find(sub, start)
		if start == -1:
			return
		yield start
		start += len(sub)

def SieveOfEratosthenes(n, isPrime):
	isPrime[0] = isPrime[1] = False
	for i in range(2, n):
		isPrime[i] = True
	p = 2
	while p * p <= n:
		if isPrime[p] == True:
			i = p * p
			while i <= n:
				isPrime[i] = False
				i += p
		p += 1
	return isPrime

def dijkstra(edges, f, t):
	g = defaultdict(list)
	for (l, r, c) in edges:
		g[l].append((c, r))
	(q, seen, mins) = ([(0, f, ())], set(), {f: 0})
	while q:
		(cost, v1, path) = heappop(q)
		if v1 not in seen:
			seen.add(v1)
			path = (v1, path)
			if v1 == t:
				return (cost, path)
			for (c, v2) in g.get(v1, ()):
				if v2 in seen:
					continue
				prev = mins.get(v2, None)
				next = cost + c
				if prev is None or next < prev:
					mins[v2] = next
					heappush(q, (next, v2, path))
	return float('inf')

def binsearch(a, l, r, x):
	while l <= r:
		mid = l + (r - 1) // 2
		if a[mid]:
			return mid
		elif a[mid] > x:
			l = mid - 1
		else:
			r = mid + 1
	return -1

def readTree(n):
	adj = [set() for _ in range(n)]
	for _ in range(n - 1):
		(u, v) = map(int, input().split())
		adj[u - 1].add(v - 1)
		adj[v - 1].add(u - 1)
	return adj

def treeOrderByDepth(n, adj, root=0):
	parent = [-2] + [-1] * (n - 1)
	ordered = []
	q = deque()
	q.append(root)
	depth = [0] * n
	while q:
		c = q.popleft()
		ordered.append(c)
		for a in adj[c]:
			if parent[a] == -1:
				parent[a] = c
				depth[a] = depth[c] + 1
				q.append(a)
	return (ordered, parent, depth)

def isSubSequence(str1, str2):
	m = len(str1)
	n = len(str2)
	j = 0
	i = 0
	while j < m and i < n:
		if str1[j] == str2[i]:
			j = j + 1
		i = i + 1
	return j == m

def nextPowerOf2(n):
	count = 0
	if n and (not n & n - 1):
		return n
	while n != 0:
		n >>= 1
		count += 1
	return 1 << count

def cou(n):
	c = 0
	while n > 1:
		c += 1
		n //= 2
	return c

def sortsec(l):
	return sorted(l, key=lambda x: x[1])

def BinarySearch(a, x):
	i = bisect_left(a, x)
	if i:
		return i - 1
	else:
		return -1

def subarray(A):
	r = set()
	p = {0}
	for x in A:
		p = {x | y for y in p} | {x}
		r |= p
	return len(r)
for _ in range(ii()):
	(a, b) = mi()
	print(int(ceil(abs(b - a) / 10)))


from os import path
import sys
from heapq import heappush, heappop
from functools import cmp_to_key as ctk
from collections import deque, defaultdict as dd
from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right
from itertools import permutations
from datetime import datetime
from math import ceil, sqrt, log, gcd

def ii():
	return int(input())

def si():
	return input().rstrip()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
abc = 'abcdefghijklmnopqrstuvwxyz'
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def bo(i):
	return ord(i) - ord('a')
file = 1

def solve():
	for _ in range(ii()):
		(a, b) = mi()
		x = abs(a - b)
		print(ceil(x / 10))
if file:
	if path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	else:
		input = sys.stdin.readline
solve()


for k in range(int(input(''))):
	l = [int(x) for x in input('').split()]
	a = max(l)
	b = min(l)
	if a == b:
		print(0)
	elif a - b <= 10 and a - b > 0:
		print(1)
	elif int((a - b) / 10) == (a - b) / 10:
		print((a - b) // 10)
	else:
		print(int((a - b) // 10) + 1)


from math import ceil
testcase = int(input())
for i in range(testcase):
	k = 10
	count = 0
	n = 0
	(a, b) = list(map(int, input().split()))
	if a == b:
		print(count)
	else:
		if a > b:
			max = a
			min = b
			diff = a - b
		else:
			max = b
			min = a
			diff = b - a
		count = diff // 10
		if diff % 10 != 0:
			count += 1
		print(count)


def count(a, b):
	if a == b:
		return 0
	if a > b:
		k = a - b
		if k <= 10:
			return 1
		else:
			power = k // 10
			if k % 10 == 0:
				return power
			return power + 1
	else:
		k = b - a
		if k <= 10:
			return 1
		else:
			power = k // 10
			if k % 10 == 0:
				return power
			return power + 1
t = int(input())
for _ in range(t):
	(a, b) = map(int, input().rstrip().split())
	print(count(a, b))


t = int(input(''))
while t:
	elements = input('')
	elements = elements.split()
	lst = []
	for element in elements:
		lst.append(int(element))
	k = abs(lst[0] - lst[1])
	count = k // 10
	if k % 10 != 0:
		count += 1
	print(count)
	t -= 1


for tt in range(int(input())):
	(a, b) = map(int, input().split())
	x = abs(a - b)
	r = x // 10
	if x % 10 != 0:
		r += 1
	print(r)


for _ in range(int(input())):
	(a, b) = [int(x) for x in input().split()]
	(a, b) = (min(a, b), max(a, b))
	ans = b - a
	k = 10
	count = 0
	while ans > 0 and k >= 1:
		count += ans // k
		ans = ans % k
		k -= 1
	print(count)


t = int(input())
for j in range(t):
	(a, b) = map(int, input().split())
	diff = abs(a - b)
	if diff <= 10 and diff != 0:
		print(1)
	elif diff <= 10 and diff == 0:
		print(0)
	else:
		count = 0
		i = 10
		while i >= 1:
			count = count + diff // i
			diff = diff % i
			if diff == 0:
				break
			i -= 1
		print(count)


t = int(input())
kt = 0
min_k = []
while kt < t:
	kt += 1
	(a, b) = input().split()
	a_b = abs(int(a) - int(b))
	if a_b % 10 == 0:
		min_k.append(a_b // 10)
	else:
		min_k.append(a_b // 10 + 1)
for k in min_k:
	print(k)


t = int(input())
while t:
	t = t - 1
	(a, b) = map(int, input().split())
	if a == b:
		print('0')
		continue
	if a > b:
		temp = a - b
	else:
		temp = b - a
	ans = 0
	if temp % 10 != 0:
		ans = ans + 1
		temp = temp - temp % 10
	ans = ans + temp // 10
	print(ans)


import sys
import math
fast_reader = sys.stdin.readline
fast_writer = sys.stdout.write

def input():
	return fast_reader().strip()

def print(*argv):
	fast_writer(' '.join((str(i) for i in argv)))
	fast_writer('\n')
for T in range(int(input())):
	(a, b) = map(int, input().split())
	ans = 0
	if a < b:
		ans = (b - a) / 10
	elif a > b:
		ans = (a - b) / 10
	ans = math.ceil(ans)
	ans = int(ans)
	print(ans)


ar = []
for i in range(int(input())):
	(a, b) = [int(x) for x in input().split()]
	if abs(a - b) > 10 and abs(a - b) % 10 != 0:
		ar.append(abs(a - b) // 10 + 1)
	elif abs(a - b) < 10 and abs(a - b) != 0:
		ar.append(1)
	else:
		ar.append(abs(a - b) // 10)
for ans in ar:
	print(ans)


from math import ceil
t = int(input())
for _ in range(t):
	(x, y) = map(int, input().strip().split())
	if x > y:
		(x, y) = (y, x)
	print(ceil((y - x) / 10))


import math
for x in range(int(input())):
	(h, m) = list(map(int, input().split()))
	print(math.ceil(abs((h - m) / 10)))


n = int(input())
for _ in range(n):
	(a, b) = map(int, input().split())
	c = a - b
	if c == 0:
		print(c)
	elif a > b:
		p = a - b
		d = p / 10
		e = int(d)
		if d > e:
			print(e + 1)
		else:
			print(e)
	else:
		q = b - a
		f = q / 10
		g = int(f)
		if f > g:
			print(g + 1)
		else:
			print(g)


ans = []
for it in range(int(input())):
	(a, b) = map(int, input().split())
	tmp = abs(b - a)
	if tmp % 10:
		ans += [tmp // 10 + 1]
	else:
		ans += [tmp // 10]
print(*ans, sep='\n')


T = int(input())
for t in range(T):
	line = input().split(' ')
	(a, b) = (int(line[0]), int(line[1]))
	diff = abs(a - b)
	if diff % 10 == 0:
		print(diff // 10)
	else:
		print(diff // 10 + 1)


t = int(input())
for i in range(t):
	c = input()
	(a, b) = c.split(' ')
	if int(a) > int(b):
		print(f'{(int(a) - int(b)) // 10 + int((int(a) - int(b)) % 10 != 0)}')
	else:
		print(f'{(int(b) - int(a)) // 10 + int((int(b) - int(a)) % 10 != 0)}')


t = int(input())
import math
while t != 0:
	t -= 1
	(n, p) = map(int, input().split())
	if n == p:
		print('0')
	elif n < p:
		if p - n <= 10:
			print('1')
		else:
			print(int(math.ceil((p - n) / 10)))
	elif n - p <= 10:
		print('1')
	else:
		print(int(math.ceil((n - p) / 10)))


import math
import os
import random
import re
import sys
from collections import defaultdict, Counter, deque
import heapq
from functools import lru_cache
from itertools import accumulate, chain, combinations, permutations, groupby, zip_longest
from math import floor, ceil, sqrt
t = int(input())
res = []
for _ in range(t):
	(a, b) = map(int, input().split())
	diff = abs(a - b)
	res += (diff // 10 + int(diff % 10 > 0),)
for v in res:
	print(v)


t = int(input())
for i in range(t):
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	t = max(a, b)
	b = a + b - t
	s = (t - b) // 10
	if (t - b) % 10 > 0:
		s = s + 1
	print(s)


import sys, math
input = lambda : sys.stdin.readline().rstrip()
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	else:
		c = max(a, b) - min(a, b)
		ans = c // 10
		if c % 10 != 0:
			ans += 1
		print(ans)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	diff = a - b if a > b else b - a
	tmp1 = diff // 10
	tmp = diff % 10
	if diff % 10 == 0:
		tmp = 0
	else:
		tmp = 1
	res = tmp1 + tmp
	print(res)


for n in [*open(0)][1:]:
	(p, q) = map(int, n.split())
	print(0 - -abs(p - q) // 10)


import sys
import collections
from collections import Counter, deque
import itertools
import math
import timeit
import random

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):
	divisors = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				divisors.append(i)
			else:
				divisors.extend([i, n // i])
	return divisors

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def flin(d, x, default=-1):
	left = right = -1
	for i in range(len(d)):
		if d[i] == x:
			if left == -1:
				left = i
			right = i
	if left == -1:
		return (default, default)
	else:
		return (left, right)

def ceil(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return 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 prr(a, sep=' '):
	print(sep.join(map(str, a)))

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)
ans = []
for _ in range(ii()):
	(a, b) = mi()
	ans.append(ceil(abs(a - b), 10))
prr(ans, '\n')


def solution(a, b):
	(a, b) = (min(a, b), max(a, b))
	val = b - a
	return (val + 9) // 10
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	print(solution(a, b))


n = int(input())
for i in range(n):
	(a, b) = [int(num) for num in input().split()]
	print((abs(a - b) + 9) // 10 % 1000000007)


t = int(input())
for i in range(t):
	(a, b) = list(map(int, input().split()))
	if a > b or a < b:
		x = abs(a - b)
		moves = 0
		while x != 0:
			if x >= 10:
				moves = x // 10
				x = x % 10
			elif x >= 9 and x < 10:
				moves += 1
				x -= 9
			elif x >= 8 and x < 9:
				moves += 1
				x -= 8
			elif x >= 7 and x < 8:
				moves += 1
				x -= 7
			elif x >= 6 and x < 7:
				moves += 1
				x -= 6
			elif x >= 5 and x < 6:
				moves += 1
				x -= 5
			elif x >= 4 and x < 5:
				moves += 1
				x -= 4
			elif x >= 3 and x < 4:
				moves += 1
				x -= 3
			elif x >= 2 and x < 3:
				moves += 1
				x -= 2
			elif x >= 1 and x < 2:
				moves += 1
				x -= 1
		print(moves)
	else:
		print(0)


import sys
from math import sqrt, gcd, ceil, log, floor
from bisect import bisect, bisect_left
from collections import defaultdict, Counter, deque
from heapq import heapify, heappush, heappop
input = sys.stdin.readline
read = lambda : list(map(int, input().strip().split()))

def main():
	for _ in range(int(input())):
		(a, b) = read()
		print(abs(b - a) // 10 + (abs(a - b) % 10 > 0))
main()


from math import *
t = int(input())
for tc in range(t):
	(a, b) = map(int, input().split())
	c = abs(a - b)
	print(f'{ceil(c / 10)}')


import sys

def swap(x, y, a):
	temp = a[x]
	a[x] = a[y]
	a[y] = temp
	return a

def solve():
	return None

def main():
	q = []
	for line in sys.stdin.readlines():
		q.append(line)
	for i in range(len(q)):
		q[i] = q[i].rstrip().split(' ')
		q[i] = [int(x) for x in q[i]]
	for i in range(1, len(q)):
		a = max(q[i][0], q[i][1])
		b = min(q[i][0], q[i][1])
		x = a - b
		if x % 10 == 0:
			print(x // 10)
		else:
			print(x // 10 + 1)
main()


for i in range(int(input())):
	(a, b) = map(int, input().split())
	c = abs(b - a)
	print((c + 9) // 10)


t = int(input())
x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
for _ in range(t):
	inp = list(map(int, input().split()))
	a = inp[0]
	b = inp[1]
	m = abs(a - b)
	ans = 0
	for i in range(len(x) - 1, -1, -1):
		item = x[i]
		if m >= item:
			ans += m // item
			m = m % item
	print(ans)


t = int(input())
import math
for i in range(0, t):
	(a, b) = list(map(int, input().split()))
	p = 0
	if a > b:
		p = math.ceil((a - b) / 10)
	elif b > a:
		p = math.ceil((b - a) / 10)
	print(p)


from math import fabs
T = int(input())
for i in range(T):
	(a, b) = map(int, input().split())
	if (a - b) % 10 == 0:
		print(int(fabs(a - b) // 10))
	else:
		print(int(fabs(a - b) // 10 + 1))


t = int(input())
for i in range(t):
	(a, b) = input().split(' ')
	a = int(a)
	b = int(b)
	x = 0
	while a != b:
		d = abs(b - a)
		if a < b:
			if d >= 10:
				x += d // 10
				a += x * 10
			else:
				a += d % 10
				x += 1
		elif d >= 10:
			x += d // 10
			a -= x * 10
		else:
			a -= d % 10
			x += 1
	print(x)


import math
t = int(input())
for i in range(t):
	(x, y) = input().split()
	x = int(x)
	y = int(y)
	k = math.fabs(x - y)
	print(math.ceil(k / 10))


import math
t = int(input())
y = []
for _ in range(t):
	(a, b) = map(int, input().split())
	x = abs(a - b)
	if x % 10 == 0:
		y.append(x // 10)
	else:
		y.append(x // 10 + 1)
for e in y:
	print(e)


import math
import sys
from sys import *
import heapq
from collections import deque, defaultdict
from itertools import permutations, combinations, combinations_with_replacement
import random
import os
mod = 10 ** 9 + 7
MAX = sys.maxsize
MIN = -sys.maxsize - 1

def isPrime(n):
	if n > 1:
		for i in range(2, n):
			if n % i == 0:
				return False
		else:
			return True
	else:
		return False

def isPanagram(s):
	alphabet = 'abcdefghijklmnopqrstuvwxyz'
	for char in alphabet:
		if char not in s.lower():
			return False
	return True

def diff(list1):
	res = [list1[i + 1] - list1[i] for i in range(len(list1) - 1)]
	return res

def isEqual(list1):
	if len(list1) < 0:
		res = True
	res = all((ele == list1[0] for ele in list1))
	if res:
		return True
	else:
		return False

def remove_duplicate(list1):
	final_list = list(set(list1))
	return final_list

def solve():
	(a, b) = map(int, input().split())
	if a == b:
		return 0
	k = abs(a - b)
	if k % 10 == 0:
		return k // 10
	else:
		return k // 10 + 1
t = int(stdin.readline().strip())
for i in range(t):
	result = solve()
	stdout.write(str(result) + '\n')


n = int(input())
for i in range(n):
	a = list(map(int, input().split()))
	if a[0] < a[1]:
		m = (a[1] - a[0]) // 10
	else:
		m = (a[0] - a[1]) // 10
	if (a[0] - a[1]) % 10 != 0:
		m += 1
	print(m)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	c = 0
	if a == b:
		print(0)
	else:
		d = abs(a - b)
		if d in range(1, 11):
			print(1)
		elif d % 10 == 0:
			print(d // 10)
		else:
			print(d // 10 + 1)


import sys, os
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
input = lambda : sys.stdin.readline().strip()
li = lambda : list(map(int, input().split()))
I = lambda : int(input())
for _ in range(I()):
	(a, b) = li()
	if abs(a - b) % 10 == 0:
		print(abs(a - b) // 10)
	else:
		print(abs(a - b) // 10 + 1)


for i in range(int(input())):
	(a, b) = map(int, input().split())
	total = 0
	if a < b:
		u = b - a
	else:
		u = a - b
	c = 10
	while u != 0:
		b = divmod(u, c)
		total += b[0]
		u = b[1]
		c -= 1
		if c > u:
			c = u
	print(total)


t = int(input())
A = []
for i in range(t):
	(a, b) = (int(y) for y in input().split())
	if a > b and (a - b) % 10 == 0:
		A.append(int((a - b) / 10))
	elif a > b and (a - b) % 10 != 0:
		A.append(int((a - b) / 10) + 1)
	elif a < b and (b - a) % 10 == 0:
		A.append(int((b - a) / 10))
	elif a < b and (b - a) % 10 != 0:
		A.append(int((b - a) / 10) + 1)
	else:
		A.append(0)
for j in A:
	print(j)


from math import floor
t = int(input())
for i in range(t):
	(a, b) = list(map(int, input().split()))
	k = 0
	n = 0
	c = 0
	if b > a:
		while a != b:
			if b - a >= 10:
				c = floor((b - a) // 10)
				b -= c * 10
				n += c
			else:
				a = b
				n += 1
	elif b < a:
		while b != a:
			if a - b >= 10:
				c = floor((a - b) // 10)
				a -= c * 10
				n += c
			else:
				b = a
				n += 1
	print(n)


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	moves = 0
	dif = abs(a - b)
	if dif >= 10:
		moves = moves + dif // 10
	resto = dif % 10
	if resto > 0:
		moves = moves + 1
	print(moves)


import math
case = int(input())
for numero in range(case):
	nums = input().split()
	a = int(nums[0])
	b = int(nums[1])
	x = (a - b) / 10
	parte_decimal = abs(x) - abs(int(x))
	if round(parte_decimal, 1) != 0.0:
		print(abs(int(x)) + 1)
	else:
		print(abs(round(x)))


import sys

def solve(a, b):
	diff = abs(a - b)
	cnt = diff // 10
	return cnt + (1 if cnt * 10 < diff else 0)
IN = [x.strip() for x in sys.stdin.readlines()]
T = int(IN[0])
cur = 0
for ti in range(T):
	(a, b) = [int(x) for x in IN[cur + 1].split(' ')]
	res = solve(a, b)
	print(res)
	cur += 1


import math
my_value = []
for i in range(int(input())):
	(a, b) = [int(x) for x in input().split()]
	if b > a:
		my_value.append(math.ceil((b - a) / 10))
	else:
		my_value.append(math.ceil((a - b) / 10))
for i in my_value:
	print(i)


import sys
import bisect
import math as mt
input = sys.stdin.readline
t = int(input())
mod = 10 ** 9 + 7
for _ in range(t):
	(a, b) = map(int, input().split())
	maxi = max(a, b)
	mini = min(a, b)
	diff = maxi - mini
	ans = diff // 10
	diff %= 10
	if diff != 0:
		ans += 1
	print(ans)


import sys

def rs():
	return sys.stdin.readline().rstrip()

def ri():
	return int(sys.stdin.readline())

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

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math
from collections import defaultdict
for _ in range(ri()):
	(a, b) = ria()
	x = abs(a - b)
	wi(x // 10) if x % 10 == 0 else wi(x // 10 + 1)


test_cases = int(input())
ans = []
for i in range(test_cases):
	moves = 0
	counter = 10
	(a, b) = [int(x) for x in input().split(' ')]
	dif = abs(b - a)
	while counter != 0:
		moves += dif // counter
		dif = dif % counter
		counter -= 1
	ans.append(moves)
for move in ans:
	print(move)


def diff(a, b):
	if a == b:
		return 0
	elif a > b:
		minus = a - b
	else:
		minus = b - a
	ans = 0
	if minus >= 10:
		ans += minus // 10
		minus = minus % 10
	if minus % 10 != 0:
		ans += 1
	return ans
t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	print(diff(a, b))


import sys
t = int(input().strip())
for a0 in range(t):
	l = [int(i) for i in input().split()]
	n = l[0]
	k = l[1]
	if k > n:
		temp = n
		n = k
		k = temp
	c1 = 0
	c2 = 0
	if (n - k) % 10 == 0:
		print((n - k) // 10)
	else:
		print((n - k) // 10 + 1)


import math, sys, itertools

def solve(a, b):
	dif = abs(a - b)
	ans = int(math.ceil(dif / 10))
	return ans
for _ in range(int(input())):
	(a, b) = [int(x) for x in input().split()]
	print(solve(a, b))


import sys
from math import sqrt
from collections import defaultdict
inpt = sys.stdin.readline

def inp():
	return int(inpt())

def inlist():
	return list(map(int, inpt().split()))

def instr():
	s = inpt()
	return list(s[:len(s) - 1])

def invr():
	return map(int, inpt().split())

class Graph:

	def __init__(self, n):
		self.n = n
		self.graph = defaultdict(list)
		self.marked = defaultdict(int)

	def addEdge(self, u, v):
		self.graph[u].append(v)
		self.graph[v].append(u)

	def dfs(self, u):
		self.marked[u] = 1
		for i in self.graph[u]:
			if self.marked[i] == 0:
				self.dfs(i)

def main():
	t = inp()
	for l in range(t):
		(a, b) = invr()
		if a == b:
			ans = 0
		else:
			ans = abs(b - a) // 10
			if abs(b - a) % 10 != 0:
				ans += 1
		print(ans)
main()


t = int(input())
output = []
for i in range(t):
	(a, b) = map(int, input().split())
	c = 0
	if abs(b - a) != 0:
		d = abs(b - a)
		q = d // 10
		r = d % 10
		if r == 0:
			c = q
		else:
			c = q + 1
	output.append(c)
for i in output:
	print(i)


n = int(input())
for i in range(0, n):
	(a, b) = map(int, input().split())
	c = a - b
	d = abs(c)
	if d % 10 == 0:
		p = d / 10
		e = int(p)
		print(e)
	else:
		q = d / 10
		n = int(q)
		print(n + 1)


from collections import Counter
import string
import math
import sys
from fractions import Fraction

def array_int():
	return [int(i) for i in sys.stdin.readline().split()]

def vary(arrber_of_variables):
	if arrber_of_variables == 1:
		return int(sys.stdin.readline())
	if arrber_of_variables >= 2:
		return map(int, sys.stdin.readline().split())

def makedict(var):
	return dict(Counter(var))

def printDivisors(n):
	divisors = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n // i == i:
				divisors.append(i)
			else:
				divisors.extend((i, n // i))
		i = i + 1
	return divisors

def countTotalBits(num):
	binary = bin(num)[2:]
	return len(binary)

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
for _ in range(vary(1)):
	(a, b) = vary(2)
	pt = abs(a - b)
	ans = 0
	for i in range(10, 0, -1):
		ans += pt // i
		pt = pt % i
	print(ans)


from math import ceil
for T in range(int(input())):
	(a, b) = list(map(int, input().split()))
	(b, a) = (max(a, b), min(a, b))
	d = b - a
	print(ceil(d / 10))


from sys import stdin

def iinput():
	return int(stdin.readline())

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

def linput():
	return list(map(int, stdin.readline().split()))
from collections import defaultdict
from math import factorial
t = iinput()
while t:
	t -= 1
	(a, b) = minput()
	dif = abs(a - b)
	rem = 1 if dif % 10 != 0 else 0
	print(dif // 10 + rem)


test_cases = int(input())

def solve():
	data = input().split(' ')
	a = int(data[0])
	b = int(data[1])
	diff = abs(a - b)
	min_moves = diff // 10
	if diff % 10 != 0:
		min_moves += 1
	print(min_moves)
for i in range(test_cases):
	solve()


import math
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if a > b:
		(a, b) = (b, a)
	res = math.ceil((b - a) / 10)
	print(res)


t = int(input())
while t > 0:
	t -= 1
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	c = abs(a - b)
	if c % 10 == 0:
		print(c // 10)
	else:
		print(c // 10 + 1)


from sys import stdin, stdout
import heapq
import cProfile
from collections import Counter, defaultdict, deque
from functools import reduce
import math

def get_int():
	return int(stdin.readline().strip())

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

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

def solve():
	(ans, num) = (0, 10)
	(a, b) = get_tuple()
	if a > b:
		(a, b) = (b, a)
	rem = b - a
	while rem > 0:
		(div, rem) = divmod(rem, num)
		num -= 1
		ans += div
	print(ans)

def main():
	solve()
TestCases = True
if TestCases:
	for i in range(get_int()):
		main()
else:
	main()


num_of_test_cases = int(input())
answer = 0
for i in range(num_of_test_cases):
	(a, b) = [int(i) for i in input().split()]
	if abs(a - b) % 10 != 0:
		print(abs(a - b) // 10 + 1)
	else:
		print(abs(a - b) // 10)


import math
t = int(input())
while t > 0:
	t -= 1
	(a, b) = [int(j) for j in input().split()]
	temp = abs(a - b)
	print(math.ceil(temp / 10))


t = int(input())
for j in range(0, t):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	else:
		ee = abs(b - a)
		if ee % 10 == 0:
			print(ee // 10)
		else:
			print(ee // 10 + 1)


import math

def solve(a, b):
	if a == b:
		return 0
	diff = abs(a - b)
	return math.ceil(diff / 10)
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	print(solve(a, b))


casee = int(input())
for cases in range(0, casee, 1):
	s = input()
	(a, b) = s.split()
	a = int(a)
	b = int(b)
	if a == b:
		print(0)
	else:
		c = abs(a - b)
		kk = c / 10
		if kk - int(kk) == 0:
			print(int(kk))
		else:
			k = int(kk) + 1
			print(int(k))


t = int(input())
while t > 0:
	(a, b) = map(int, input().split())
	dfc = abs(a - b)
	minimo = dfc // 10 + (dfc % 10 != 0)
	print(minimo)
	t -= 1


t = int(input())
import math

def solve(a, b):
	res = math.ceil(abs(b - a) / 10)
	return res
for _ in range(t):
	(n, s) = [int(x) for x in input().split(' ')]
	print(solve(n, s))


t = int(input())
for _ in range(t):
	ab = list(map(int, input().split()))
	a = ab[0]
	b = ab[1]
	r = abs(a - b)
	if r == 0:
		print('0')
	else:
		if r % 10 == 0:
			res = r // 10
		else:
			res = r // 10 + 1
		print(res)


N_SETS = int(input())
for i in range(N_SETS):
	(a, b) = [int(x) for x in input().split()]
	(a, b) = (min(a, b), max(a, b))
	print((b - a) // 10 + int((b - a) % 10 != 0))


try:
	t = int(input())
	for i in range(t):
		(a, b) = list(map(int, input().split()))
		res = abs(a - b)
		if res % 10 == 0:
			print(int(res / 10))
			continue
		res = int(res / 10) + 1
		print(res)
except:
	pass


def main():
	T = int(input())
	for _ in range(T):
		(a, b) = (int(i) for i in input().split())
		if a < b:
			(a, b) = (b, a)
		ans = abs(b - a) // 10
		if abs(b - a) % 10 != 0:
			ans += 1
		print(ans)
main()


t = int(input())
while t != 0:
	step = 0
	(a, b) = input().split(' ')
	a = int(a)
	b = int(b)
	ans = abs(a - b)
	if ans != 0:
		step = step + ans // 10
	if ans % 10 != 0:
		step = step + 1
	print(step)
	t = t - 1


def solveTestCase(a, b):
	diff = abs(b - a)
	if diff % 10 == 0:
		return diff // 10
	else:
		return 1 + diff // 10
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	print(solveTestCase(a, b))


t = int(input())
for i in range(t):
	(n1, n2) = map(int, input().split())
	if n1 >= n2:
		k = n1 - n2
		n = k // 10
		if k % 10 == 0:
			print(n)
		else:
			print(n + 1)
	else:
		k = n2 - n1
		n = k // 10
		if k % 10 == 0:
			print(n)
		else:
			print(n + 1)


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	(a, b) = (min(a, b), max(a, b))
	if abs(b - a) == 0:
		print(0)
	elif abs(b - a) <= 10:
		print(1)
	else:
		mini = 10 ** 18
		for i in range(1, 11):
			z = abs(b - a) // i
			k = a
			k += z * i
			if abs(b - k) != 0:
				mini = min(z + 1, mini)
			else:
				mini = min(z, mini)
		print(mini)


line = input()
while True:
	try:
		step = 0
		line = input().split()
		a = int(line[0])
		b = int(line[1])
		if a == b:
			step = 0
		else:
			dif = abs(a - b)
			i = 10
			while dif > 0:
				step += dif // i
				dif = dif % i
				i -= 1
		print(step)
	except EOFError:
		break


import math
t = int(input())
while t > 0:
	t -= 1
	(x, y) = map(int, input().strip().split(' '))
	diff = abs(x - y)
	ans = math.ceil(diff / 10)
	print(ans)


__version__ = '0.1'
__date__ = '2021-04-01'
import sys

def solve(a, b):
	tens = (abs(b - a) + 9) // 10
	return tens

def main(argv=None):
	t = int(input())
	for _ in range(t):
		(a, b) = map(int, input().split())
		print(solve(a, b))
	return 0
STATUS = main()
sys.exit(STATUS)


import math
t = int(input())
for i in range(t):
	(a, b) = map(int, input().strip().split(' '))
	c = abs(a - b)
	c = math.ceil(c / 10)
	print(c)


import math
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	x = 0
	y = 0
	if a == b:
		print('0')
	elif a < b:
		x = b - a
		print(math.ceil(x / 10))
	else:
		y = a - b
		print(math.ceil(y / 10))


import math
t = int(input())
for i in range(t):
	(p, a) = [int(i) for i in input().split()]
	sum = abs(p - a) // 10
	if abs(p - a) % 10 != 0:
		sum += 1
	print(sum)


import sys
import time as mt, bisect, sys
import math
from sys import stdin, stdout
from collections import deque
from fractions import Fraction
from collections import Counter
from collections import OrderedDict

def si():
	return int(sys.stdin.readline())

def st():
	return stdin.readline()

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

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

def lcm(a, b):
	return a * b // gcd(a, b)

def gcd(a, b):
	if a == 0:
		return b
	elif b == 0:
		return a
	if a > b:
		return gcd(a % b, b)
	else:
		return gcd(a, b % a)
test = si()
for _ in range(test):
	(a, b) = mi()
	result = abs(a - b)
	result = result / 10
	print(math.ceil(result))


from sys import stdin, stdout
import math
try:
	t = int(input())
	for _ in range(t):
		(a, b) = map(int, input().split())
		ans = 0
		d = abs(a - b)
		ans = math.ceil(d / 10)
		print(ans)
except:
	pass


def solve(n, k):
	ans = 0
	a = min(n, k)
	b = max(n, k)
	if abs(b - a) % 10 == 0:
		ans = abs(b - a) // 10
	else:
		temp = (b - a) // 10
		ans = temp + 1
	print(ans)
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	solve(n, k)


import bisect
import copy
import fractions
import functools
import heapq
import math
import random
import sys
T = int(input())
for t in range(T):
	(A, B) = tuple(map(int, input().split()))
	print(str(math.ceil(abs(A - B) / 10)))


def d(a, b):
	if a == b:
		return 0
	else:
		d = abs(a - b)
		if d % 10 == 0:
			return d // 10
		return d // 10 + 1
for _ in range(int(input())):
	(a, b) = list(map(int, input().split()))
	print(d(a, b))


from sys import stdin, gettrace
if gettrace():
	inputi = input
else:

	def input():
		return next(stdin)[:-1]

	def inputi():
		return stdin.buffer.readline()

def solve():
	(a, b) = map(int, inputi().split())
	d = abs(a - b) // 10
	r = abs(a - b) % 10
	if r == 0:
		print(d)
	else:
		print(d + 1)

def main():
	t = int(inputi())
	for _ in range(t):
		solve()
main()


from math import ceil
for i in range(int(input())):
	(x, y) = map(int, input().split())
	(a, b) = (min(x, y), max(x, y))
	count = ceil((b - a) / 10)
	print(count)


t = input()
t = int(t)
while t > 0:
	s = input()
	(a, b) = [int(x) for x in s.split()]
	if a == b:
		print(0)
	elif abs(a - b) < 11:
		print(1)
	else:
		if a < b:
			ans = int((b - a) / 10)
		else:
			ans = int((a - b) / 10)
		if b % 10 == a % 10:
			print(ans)
		else:
			print(ans + 1)
	t -= 1


from math import ceil
n = int(input())
s = ''
for i in range(n):
	(a, b) = map(int, input().split())
	if a > b:
		s += str(ceil((a - b) / 10)) + '\n'
	if a < b:
		s += str(ceil((b - a) / 10)) + '\n'
	if a == b:
		s += '0\n'
print(s)


tot = int(input())
steps = 0
lst = list()
for i in range(tot):
	(a, b) = map(int, input().split())
	lst.append(a)
	lst.append(b)
for i in range(len(lst)):
	if i % 2 == 0:
		continue
	elif i % 2 != 0:
		a = lst[i - 1]
		b = lst[i]
		diff = a - b
		print((abs(diff) + 9) // 10)


testcases = int(input())
for x in range(testcases):
	(a, b) = map(int, input().split())
	moves = 0
	x = b - a
	if x == 0:
		print(0)
	elif x > 0:
		z = b - a
		if z % 10 == 0:
			moves += z // 10
		else:
			moves += z // 10 + 1
		print(moves)
	else:
		z = a - b
		if z % 10 == 0:
			moves += z // 10
		else:
			moves += z // 10 + 1
		print(moves)


import array
arr = array.array('i', [])
n = int(input())
ans = 0
for i in range(0, n):
	(a, b) = map(int, input().split())
	if a == b:
		ans = 0
	else:
		d = abs(a - b)
		ans = (d + 9) // 10
	arr.append(ans)
for e in arr:
	print(e)


for _ in range(int(input())):
	(x, z) = map(int, input().split())
	print((abs(x - z) + 9) // 10)


import math
t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	distancia = abs(a - b)
	pasos = distancia / 10
	total = math.ceil(pasos)
	print(total)


T = int(input())
for _ in range(T):
	(a, b) = list(map(int, input().split()))
	d = abs(a - b)
	ans = d // 10 + int(d % 10 > 0)
	print(ans)


from sys import stdin, stdout
from math import gcd, sqrt, factorial, pi
from collections import deque, defaultdict
input = stdin.readline
R = lambda : map(int, input().split())
I = lambda : int(input())
S = lambda : input().rstrip('\n')
L = lambda : list(R())
P = lambda x: stdout.write(x)
lcm = lambda x, y: x * y // gcd(x, y)
hg = lambda x, y: (y + x - 1) // x * x
pw = lambda x: 1 if x == 1 else 1 + pw(x // 2)
chk = lambda x: chk(x // 2) if not x % 2 else True if x == 1 else False
sm = lambda x: (x ** 2 + x) // 2
N = 10 ** 9 + 7
for _ in range(I()):
	(a, b) = R()
	print((abs(a - b) + 9) // 10)


x = int(input())
k = list()
for i in range(x):
	a = list(map(int, input().split()))
	x = abs(a[0] - a[1])
	if x % 10 == 0:
		k.append(x // 10)
	else:
		k.append(x // 10 + 1)
for i in k:
	print(i)


import math
for i in range(int(input())):
	a = list(map(int, input().strip().split()))[:2]
	b = abs(a[0] - a[1])
	d = math.ceil(b / 10)
	print(d)


for _ in range(int(input())):
	(a, b) = map(int, input().strip().split())
	d = abs(a - b)
	l = [i for i in range(10, 0, -1)]
	s = 0
	for i in l:
		if d >= i:
			s += d // i
			d = d % i
	print(s)


a = int(input())
for i in range(a):
	(a, b) = map(int, input().split())
	c = max(a, b) - min(a, b)
	d = c / 10
	e = c % 10
	if e == 0:
		print(int(d))
	else:
		d = d + 1
		print(int(d))


def moves(a, b):
	if b != a:
		if b > a:
			if (b - a) % 10 != 0:
				return (b - a) // 10 + 1
			return (b - a) // 10
		else:
			if (a - b) % 10 != 0:
				return (a - b) // 10 + 1
			return (a - b) // 10
	else:
		return 0
test_cases = int(input())
for i in range(0, test_cases):
	info = list(map(int, input().split()))
	a = info[0]
	b = info[1]
	print(moves(a, b))


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	x = a - b
	if x < 0:
		x = -1 * x
	y = x // 10
	if x % 10 > 0:
		y += 1
	print(y)


t = int(input())
while t > 0:
	t = t - 1
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	else:
		m = abs(a - b)
		if m < 10:
			print(1)
		elif m % 10 == 0:
			print(m // 10)
		else:
			print(m // 10 + 1)


import sys
input = sys.stdin.readline
output = sys.stdout.write

def main():
	test_cases = int(input().rstrip())
	for i in range(test_cases):
		(a, b) = map(int, input().rstrip().split())
		dif = abs(a - b)
		multiplier = dif // 10
		ans = multiplier
		if dif - 10 * ans > 0:
			ans += 1
		output(str(ans))
		output('\n')
main()


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log2, ceil, pi, sin, cos, acos, atan
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
from bisect import insort
from collections import Counter
from collections import deque
from heapq import heappush, heappop, heapify
from itertools import permutations, combinations
mod = int(1000000000.0) + 7
ip = lambda : int(stdin.readline())
inp = lambda : map(int, stdin.readline().split())
ips = lambda : stdin.readline().rstrip()
out = lambda x: stdout.write(str(x) + '\n')
t = ip()
for _ in range(t):
	(a, b) = inp()
	diff = abs(a - b)
	ans = diff // 10
	diff %= 10
	if diff != 0:
		ans += 1
	out(ans)


import math
for t in range(int(input())):
	(a, b) = map(int, input().split())
	if a > b:
		p = a - b
		c = math.ceil(p / 10)
	else:
		p = b - a
		c = math.ceil(p / 10)
	print(c)


def solve3(gap):
	ans = 0
	for divider in range(10, 0, -1):
		ans += gap // divider
		gap %= divider
	return ans
for testcases in range(int(input())):
	(a, b) = map(int, input().split())
	print(solve3(abs(a - b)))


for case in range(int(input())):
	(a, b) = [int(x) for x in input().split()]
	if a > b:
		(a, b) = (b, a)
	c = b - a
	res = 0
	for k in range(10, 0, -1):
		res += c // k
		c = c % k
	print(res)


for test in range(int(input())):
	(a, b) = map(int, input().split())
	temp = a - b
	if temp == 0:
		print(0)
		continue
	if a < b:
		temp = -temp
	if temp <= 10:
		print(1)
		continue
	x = temp // 10
	if temp % 10 != 0:
		print(x + 1)
	else:
		print(x)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	answer = 0
	if a > b:
		difference = a - b
	else:
		difference = b - a
	arr = [int(i) for i in str(difference)]
	for i in range(len(arr)):
		if len(arr[i:]) - 1 == 0 and arr[i] != 0:
			answer += 1
		else:
			answer += arr[i] * 10 ** (len(arr[i:]) - 1) / 10
	print(int(answer))


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	elif a < b:
		x = b - a
		if x % 10 == 0:
			y1 = x / 10
			print(int(y1))
		else:
			y1 = x // 10
			print(int(y1 + 1))
	elif a > b:
		x2 = a - b
		if x2 % 10 == 0:
			y3 = x2 // 10
			print(int(y3))
		else:
			y3 = x2 // 10
			print(int(y3 + 1))


import math

def getMinMoves(a, b):
	if a == b:
		return 0
	return math.ceil(abs(a - b) / 10)
testCases = input()
for i in range(int(testCases)):
	(a, b) = map(int, input().split())
	ans = getMinMoves(a, b)
	print(ans)


NumOfTests = int(input())
for counter in range(NumOfTests):
	inputs = list(map(int, input().split()))
	a = int(inputs[0])
	b = int(inputs[1])
	temp = abs(b - a)
	moves = temp // 10
	temp -= moves * 10
	while temp != 0:
		temp = 0 if temp <= 10 else temp - 10
		moves += 1
	print(moves)


import os
import sys
import math
import collections

def get_int():
	return int(input())

def get_ints():
	return map(int, input().split())

def get_strs():
	return input().split()

def get_float():
	return float(input())

def get_floats():
	return map(float, input().split())

def list_strs():
	return list(input().split())

def list_ints():
	return list(map(int, input().split()))

def list_floats():
	return list(map(float, input.split()))

def post(x):
	print(x, end=' ')
T = int(input())
for t in range(1, T + 1):
	(a, b) = get_ints()
	d = abs(a - b)
	d = (d + 9) // 10
	print(d)


x = int(input())
test_cases = []
for i in range(x):
	a = [int(x) for x in input().split()]
	test_cases.append(a)
for t in test_cases:
	if t[0] == t[1]:
		print(0)
	else:
		a = t[0]
		b = t[1]
		counter = 0
		if b > a:
			diff = b - a
			while diff != 0:
				if diff >= 10:
					a = a + int(diff / 10) * 10
					counter = counter + int(diff / 10)
					diff = b - a
				else:
					a = a + diff
					diff = b - a
					counter = counter + 1
		else:
			diff = a - b
			while diff != 0:
				if diff >= 10:
					a = a - int(diff / 10) * 10
					counter = counter + int(diff / 10)
					diff = a - b
				else:
					a = a - diff
					diff = a - b
					counter = counter + 1
		print(counter)


from math import ceil
x = int(input())
lst = []
for a in range(x):
	inp = input()
	space_inp = [int(q) for q in inp.split(' ')[:2]]
	lst.append(space_inp)
ans = []
for (a, b) in lst:
	if a >= b:
		c = a - b
		c = int(ceil(c / 10))
		ans.append(c)
	if a < b:
		c = b - a
		c = int(ceil(c / 10))
		ans.append(c)
for a in ans:
	print(a)


for s in [*open(0)][1:]:
	print(0 - abs(eval(s.replace(' ', '-'))) // -10)


from math import *
t = int(input())
for _ in range(t):
	(n, m) = map(int, input().split())
	k = abs(n - m)
	p = ceil(k / 10)
	print(p)


inp = int(input())
for i in range(inp):
	s = 0
	(a, b) = input().split()
	div = abs(int(a) - int(b))
	n = 10
	while div != 0:
		s += div // n
		div -= div // n * n
		n -= 1
	print(s)


def solve(a, b):
	tmp = abs(b - a)
	moves = 0
	for i in range(10, 0, -1):
		if tmp % i >= 0:
			moves = moves + tmp // i
			tmp = tmp % i
	return moves
t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	print(solve(a, b))


t = int(input())
n = 0
for i in range(t):
	a = list(map(int, input().split()))
	if a[1] != a[0] and a[1] > a[0] and ((a[1] - a[0]) % 10 != 0):
		raznica = a[1] - a[0]
		raznica1 = raznica // 10
		print(raznica1 + 1)
	if a[1] != a[0] and a[0] > a[1] and ((a[0] - a[1]) % 10 != 0):
		raznica = a[0] - a[1]
		raznica1 = raznica // 10
		print(raznica1 + 1)
	if a[1] == a[0]:
		print(0)
	if a[1] != a[0] and a[1] > a[0] and ((a[1] - a[0]) % 10 == 0):
		raznica = a[1] - a[0]
		raznica1 = raznica // 10
		print(raznica1)
	if a[1] != a[0] and a[0] > a[1] and ((a[0] - a[1]) % 10 == 0):
		raznica = a[0] - a[1]
		raznica1 = raznica // 10
		print(raznica1)


import math
t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	print(int((max(a, b) - min(a, b)) // 10) + int((max(a, b) - min(a, b)) % 10 != 0))


def main():
	t = int(input())
	for _ in range(t):
		(n, m) = map(int, input().split())
		if n == m:
			ans = 0
		else:
			k = max(n, m) - min(m, n)
			ans = k // 10
			if k % 10 != 0:
				ans += 1
		print(ans)
main()


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	moves = 0
	difference = abs(a - b)
	moves = difference // 10
	difference = difference - moves * 10
	if difference != 0:
		moves += 1
	print(moves)


t = int(input())
for i in range(t):
	s = input().split()
	(a, b) = (int(s[0]), int(s[1]))
	q = abs(a - b)
	p = q // 10
	p += 1 if q % 10 > 0 else 0
	print(p)


import sys
input = sys.stdin.readline

def main():
	t = inp()
	for testcase in range(0, t):
		input = inlt()
		a = input[0]
		b = input[1]
		dif = b - a
		min_moves = abs(b - a) // 10
		if abs(b - a) % 10 > 0:
			min_moves += 1
		print(min_moves)

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
main()


from sys import stdin
tt = int(stdin.readline())
for loop in range(tt):
	(a, b) = map(int, stdin.readline().split())
	s = abs(a - b)
	print((s + 9) // 10)


t = int(input())
s = []
for i in range(t):
	(a, b) = map(int, input().split())
	s.append(a)
	s.append(b)
t = t * 2
for p in range(0, t, 2):
	if s[p] == s[p + 1]:
		print(0)
	elif s[p] > s[p + 1]:
		r = (s[p] - s[p + 1]) // 10
		if (s[p] - s[p + 1]) % 10 == 0:
			print(r)
		else:
			r += 1
			print(r)
	else:
		r = (s[p + 1] - s[p]) // 10
		if (s[p + 1] - s[p]) % 10 == 0:
			print(r)
		else:
			r += 1
			print(r)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(a, b) = sorted([int(i) for i in input().split()])
	c = b - a + 9
	print(c // 10)


import math
a = int(input())

def f(L):
	x = int(L[0])
	y = int(L[1])
	z = abs(math.ceil(abs(y - x) / 10))
	print(z)
for i in range(a):
	e = input().split()
	f(e)


x = int(input(''))
z = []
for i in range(0, x):
	z.append(tuple(input('').split(' ')))
for x in range(len(z)):
	z[x] = (int(z[x][0]), int(z[x][1]))
for x in z:
	a = x[0]
	b = x[1]
	diff = b - a
	steps = 0
	if diff < 0:
		diff *= -1
	for n in range(10, 0, -1):
		m = diff // n
		steps += m
		diff -= n * m
	print(steps)


def solution(n, m):
	z = n - m
	c = 0
	while z > 0:
		for i in range(10, 0, -1):
			if z // i > 0:
				c += z // i
				k = z % i
				break
		z = k
	print(c)
for i in range(int(input())):
	(n, m) = map(int, input().split())
	solution(max(n, m), min(n, m))


import math
t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	print((abs(a - b) + 9) // 10)


T = int(input())
for cs in range(T):
	(a, b) = map(int, input().split())
	print((abs(a - b) - 1) // 10 + 1 if a != b else 0)


def diff(a, b):
	if a > b:
		return a - b
	else:
		return b - a
n = int(input())
for i in range(0, n):
	string = input()
	a = int(string.split(' ')[0])
	b = int(string.split(' ')[1])
	if a == b:
		print(0)
	elif diff(a, b) % 10 == 0:
		print(int(diff(a, b) / 10))
	else:
		print(int(diff(a, b) // 10 + 1))


import math
t = int(input())
for _ in range(t):
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	c = abs(a - b)
	print(math.ceil(c / 10))


def main():
	for _ in range(int(input())):
		(a, b) = map(int, input().split())
		minimumMoves = 0
		difference = 0
		if a == b:
			minimumMoves = 0
		else:
			difference = abs(a - b)
			minimumMoves = difference // 10
			if difference % 10 != 0:
				minimumMoves += 1
		print(minimumMoves)
main()


from sys import stdin
input = stdin.readline

def main():
	t = int(input())
	for _ in range(t):
		(a, b) = map(int, input().split())
		if a == b:
			print(0)
		else:
			if a > b:
				(a, b) = (b, a)
			print((b - a + 9) // 10)
main()


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	v = abs(a - b)
	print((v + 10 - 1) // 10)


for t in range(int(input())):
	(a, b) = map(int, input().split())
	diff = abs(b - a)
	if diff == 0:
		print(0)
	elif 0 < diff <= 10:
		print(1)
	else:
		q = int(diff / 10)
		r = int(diff % 10)
		if r != 0:
			q += 1
		print(q)


def main():
	tc = int(input().strip())
	for c in range(tc):
		(a, b) = [int(i) for i in input().split(' ')]
		diff = abs(a - b)
		tmp = diff // 10
		if diff % 10 != 0:
			tmp += 1
		print(tmp)
main()


import sys
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
(t,) = I()
for _ in range(t):
	(a, b) = I()
	tt = abs(b - a)
	print(tt // 10 + bool(tt % 10))


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	k = b - a
	k = abs(k)
	count1 = 0
	while k > 0:
		if k >= 10:
			count1 += k // 10
			k = k % 10
		else:
			count1 += 1
			break
	print(count1, end='\n')


import math
t = int(input())
for i in range(t):
	l = list(map(int, input().split(' ')))
	a = l[0]
	b = l[1]
	moves = 0
	res = abs(a - b) / 10
	moves += math.floor(res)
	if abs(a - b) % 10 != 0:
		moves += 1
	print(moves)


for _ in range(int(input())):
	a = list(map(int, input().split(' ')))
	n = a[0]
	m = a[1]
	sum = abs(n - m) // 10
	if abs(n - m) % 10 != 0:
		sum += 1
	print(sum)


from sys import *
input = stdin.readline
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	(a, b) = (min(a, b), max(a, b))
	cn = (b - a) // 10
	r = (b - a) % 10
	if r > 0:
		cn += 1
	stdout.write(str(cn) + '\n')


from bisect import bisect_left
import os
import sys
from io import BytesIO, IOBase
from collections import Counter, defaultdict
from collections import deque
from functools import cmp_to_key
import math
import heapq

def sin():
	return input()

def ain():
	return list(map(int, sin().split()))

def sain():
	return input().split()

def iin():
	return int(sin())
MAX = float('inf')
MIN = float('-inf')
MOD = 1000000007

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	s = set()
	for p in range(2, n + 1):
		if prime[p]:
			s.add(p)
	return s

def readTree(n, m):
	adj = [deque([]) for _ in range(n + 1)]
	for _ in range(m):
		(u, v) = ain()
		adj[u].append(v)
		adj[v].append(u)
	return adj

def main():
	for _ in range(iin()):
		(a, b) = ain()
		x = abs(a - b)
		ans = 0
		i = 10
		while i > 0:
			ans += x // i
			x = x % i
			i -= 1
		print(ans)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
if os.getcwd() == 'D:\\code':
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
	input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


t = int(input())
while t != 0:
	t = t - 1
	number = input()
	numbers = number.split(' ')
	a = int(numbers[0])
	b = int(numbers[1])
	subtract = abs(b - a)
	if subtract == 0:
		print(subtract)
	elif subtract <= 10:
		print(1)
	elif subtract > 10:
		answer = divmod(subtract, 10)
		if answer[1] == 0:
			print(answer[0])
		else:
			print(answer[0] + 1)


import math
n = int(input())
t = []
for i in range(n):
	k = input()
	k = k.split(' ')
	g = math.ceil(abs(int(k[0]) - int(k[1])) / 10)
	t.append(g)
for i in t:
	print(i)


for _ in range(int(input())):
	(x, y) = map(int, input().split())
	if x > y:
		r = x - y
		r = r // 10
		if x - r * 10 != y:
			r += 1
		print(r)
	else:
		r = y - x
		r = r // 10
		if x + r * 10 != y:
			r += 1
		print(r)


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	ans = 0
	if a == b:
		print(ans)
	else:
		k = 10
		for i in range(k):
			if a == b:
				break
			if a > b:
				a = a - b
				while k != 0:
					ans = a // k
					a -= a // k
					k -= 1
			else:
				a = b - a
				while k != 0:
					ans = a // k
					a -= a // k
					k -= 1
		print(ans)


import sys
from math import ceil
fast_reader = sys.stdin.readline
fast_writer = sys.stdout.write

def input():
	return fast_reader().strip()

def print(*argv):
	fast_writer(' '.join((str(i) for i in argv)))
	fast_writer('\n')
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	print(ceil(abs(a - b) / 10))


def read(datatype=int):
	return datatype(input())

def readl(datatype=int):
	return list(map(datatype, input().split()))

def printl(data):
	string = ''
	for d in data:
		string += str(d) + ' '
	print(string)

def testcase():
	(a, b) = readl()
	from math import ceil
	ans = ceil(abs(a - b) / 10)
	print(ans)
	return
t = read()
for _ in range(t):
	testcase()


t = int(input())
for _ in range(t):
	(a, b) = list(map(int, input().split()))
	d = abs(a - b)
	ans = d // 10 + bool(d % 10)
	print(ans)


def ceil(a, b):
	if a % b == 0:
		return a // b
	return a // b + 1
t = int(input())
for _ in range(t):
	(a, b) = list(map(int, input().strip().split()))
	print(ceil(abs(a - b), 10))


from math import *
for i in range(int(input())):
	(a, b) = list(map(int, input().split()))
	print(ceil(abs(a - b) / 10))


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase

def main():

	def solve():
		(a, b) = [int(x) for x in input().split()]
		if a > b:
			(a, b) = (b, a)
		movesWith10 = (b - a) // 10
		a += 10 * movesWith10
		lastMove = 1 if b - a > 0 else 0
		print(movesWith10 + lastMove)
	t = int(input())
	for i in range(t):
		solve()
BUFFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
input = lambda : sys.stdin.readline().rstrip('\r\n')

def print(*args, **kwargs):
	sep = kwargs.pop('sep', ' ')
	file = kwargs.pop('file', sys.stdout)
	atStart = True
	for x in args:
		if not atStart:
			file.write(sep)
		file.write(str(x))
		atStart = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
main()


from sys import *
t = int(stdin.readline())
for _ in range(t):
	(n, m) = map(int, stdin.readline().split())
	x = abs(n - m)
	if x % 10 != 0:
		print(x // 10 + 1)
	else:
		print(x // 10)


from __future__ import division, print_function
import os, sys
import math
import collections
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

class my_dictionary(dict):

	def __init__(self):
		self = dict()

	def add(self, key, value):
		self[key] = value

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def sli():
	return list(msi())

def dmain():
	sys.setrecursionlimit(100000000)
	threading.stack_size(40960000)
	thread = threading.Thread(target=main)
	thread.start()
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[1]

def sort2(l):
	return sorted(l, key=getKey, reverse=True)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(n - r))

def binary_search(arr, low, high, x):
	if high >= low:
		mid = (high + low) // 2
		if arr[mid] == x:
			return mid
		elif arr[mid] > x:
			return binary_search(arr, low, mid - 1, x)
		else:
			return binary_search(arr, mid + 1, high, x)
	else:
		return -1

def ceil(x, y):
	if x % y == 0:
		return x // y
	else:
		return x // y + 1

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

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

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def padded_bin_with_complement(x):
	if x < 0:
		return bin(2 ** 16 - abs(x))[2:].zfill(16)
	else:
		return bin(x)[2:].zfill(16)

def binaryToDecimal(binary):
	binary1 = binary
	(decimal, i, n) = (0, 0, 0)
	while binary != 0:
		dec = binary % 10
		decimal = decimal + dec * pow(2, i)
		binary = binary // 10
		i += 1
	print(decimal)

def CountFrequency(my_list):
	freq = {}
	for item in my_list:
		if item in freq:
			freq[item] += 1
		else:
			freq[item] = 1
	return freq

def pos(a):
	b = [0] * len(a)
	c = sorted(a)
	for i in range(len(a)):
		for j in range(len(a)):
			if c[j] == a[i]:
				b[i] = j
				break
	return b

def smallestDivisor(n):
	if n % 2 == 0:
		return 2
	i = 3
	while i * i <= n:
		if n % i == 0:
			return i
		i += 2
	return n

def commonn(a, b, n):
	c = []
	for i in range(n):
		if a[i] == b[i]:
			c.append('-1')
		else:
			c.append(b[i])
	return c

def find_lcm(num1, num2):
	if num1 > num2:
		num = num1
		den = num2
	else:
		num = num2
		den = num1
	rem = num % den
	while rem != 0:
		num = den
		den = rem
		rem = num % den
	gcd = den
	lcm = int(int(num1 * num2) / int(gcd))
	return lcm

def sumdigit(n):
	n = str(n)
	k = 0
	for i in range(len(n)):
		k += int(n[i])
	return k

def main():
	for _ in range(ii()):
		(a, b) = mi()
		j = abs(a - b)
		res = math.ceil(j / 10)
		print(res)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


t = int(input())
while t > 0:
	t -= 1
	(a, b) = map(int, input().split())
	if b < a:
		temp = a
		a = b
		b = temp
	d = b - a
	c = int(d / 10)
	d = d % 10
	if d > 0:
		c += 1
	print(c)


t = int(input())
for test in range(t):
	(a, b) = [int(x) for x in input().split()]
	m = max(a, b)
	n = min(a, b)
	num = m - n
	ans = num // 10
	if num % 10 != 0:
		ans += 1
	print(ans)


n = int(input())
k = [i for i in range(1, 11)]
for i in range(n):
	count = 0
	(a, b) = list(map(int, input().split()))
	if a == b:
		count = 0
	else:
		diff = abs(b - a)
		if diff >= 10:
			times = diff // 10
			rem = diff % 10
			count += times
			if rem in range(1, 10):
				count += 1
		else:
			count = 1
	print(count)


t = int(input())
for i in range(t):
	(n, k) = input().split()
	n = int(n)
	k = int(k)
	if n > k:
		print(int((n - k) / 10 + 1) if (n - k) % 10 != 0 else int((n - k) / 10))
	elif n < k:
		print(int((k - n) / 10 + 1) if (k - n) % 10 != 0 else int((k - n) / 10))
	else:
		print(0)


t = int(input())
for _ in range(t):
	(a, b) = list(map(int, input().split()))
	ans = (abs(a - b) + 9) // 10
	print(ans)


for test in range(int(input())):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	else:
		diff = abs(a - b)
		ans = diff // 10
		if diff % 10 == 0:
			print(ans)
		else:
			print(ans + 1)


from sys import stdin, stdout
for i in range(int(stdin.readline())):
	(a, b) = map(int, stdin.readline().strip().split())
	if abs(a - b) % 10 == 0:
		print(abs(a - b) // 10)
	else:
		print(abs(a - b) // 10 + 1)


from math import ceil
for _ in range(int(input())):
	X = sorted(list(map(int, input().split())))
	print(ceil((X[-1] - X[0]) / 10))


for i in range(int(input())):
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	t = a - b if a > b else b - a
	k = t // 10
	if t % 10 != 0:
		k += 1
	print(k)


try:
	import math
	for _ in range(int(input())):
		(a, b) = map(int, input().split())
		count = 0
		if a < b:
			x = (b - a) / 10.0
			c = math.ceil(x)
		else:
			x = (a - b) / 10.0
			c = math.ceil(x)
		print(c)
except:
	pass


import math as ma
t = int(input())
for _ in range(t):
	(a, b) = input().split()
	(a, b) = (int(a), int(b))
	r = abs(a - b)
	print(ma.ceil(r / 10))


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def integer():
	return int(inp())

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')
from functools import reduce

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

def solve():
	(a, b) = sep()
	k = abs(a - b)
	t1 = k // 10
	t2 = k % 10
	if t2 == 0:
		print(t1)
	else:
		print(t1 + 1)
testcase(int(inp()))


import random

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def lcm(a, b):
	return a * b / gcd(a, b)
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	k = abs(b - a)
	c = 0
	for i in range(10, 1, -1):
		c += k // i
		k %= i
	if k == 1:
		c += 1
	print(c)


t = int(input())
from math import gcd
for _ in range(t):
	(a, b) = map(int, input().split())
	x = abs(a - b)
	ans = x // 10
	if x % 10:
		ans += 1
	print(ans)


import sys
import bisect as bi
import math
from collections import defaultdict as dd
import heapq
import itertools
input = sys.stdin.readline
mo = 10 ** 9 + 7

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())
for _ in range(inin()):
	(a, b) = cin()
	if a == b:
		print(0)
	else:
		d = abs(b - a)
		c = 1 if d % 10 != 0 else 0
		print(d // 10 + c)


import math
import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlst():
	return list(map(int, input().split()))

def instr():
	s = input()
	return list(s[:len(s) - 1])

def invar():
	return map(int, input().split())

def pba(a, b, m):
	if a == b:
		return m
	if abs(a - b) <= 10:
		return m + 1
	return math.ceil(abs(b - a) / 10)
n = inp()
for i in range(n):
	(a, b) = invar()
	m = 0
	print(pba(a, b, m))


import math
t = int(input())
for x in range(t):
	array = input().split(' ')
	a = int(array[0])
	b = int(array[1])
	moves = 0
	m = 10
	if a == b:
		print(0)
	else:
		if a < b:
			moves = math.ceil((b - a) / 10)
		else:
			moves = math.ceil((a - b) / 10)
		print(moves)


from bisect import bisect_right

def no_op(a: int, b: int) -> int:
	count = -(-abs(a - b) // 10)
	return count
T = int(input())
for _ in range(T):
	(a, b) = map(int, input().split())
	print(no_op(a, b))


import math
t = int(input())
while t > 0:
	numbers = list(map(int, input().split()))
	print(math.ceil(abs((numbers[0] - numbers[1]) / 10)))
	t = t - 1


x = int(input())
for i in range(0, x):
	num = input().split()
	if abs(int(num[1]) - int(num[0])) % 10 == 0:
		print(abs(int(num[1]) - int(num[0])) // 10)
	else:
		print(abs(int(num[1]) - int(num[0])) // 10 + 1)


t = int(input())
while t > 0:
	(a, b) = map(int, input().split())
	ctr = 0
	diff = abs(b - a)
	if a != b and diff % 10 != 0:
		ctr = 1
	print(diff // 10 + ctr)
	t -= 1


n = []
for i in range(int(input())):
	n.append(list(map(int, input().split())))
for e in n:
	e.sort()
	if e[1] != e[0]:
		c = 0
		for i in range(10, 0, -1):
			a = (e[1] - e[0]) // i
			if a > 0:
				e[0] += a * i
				c += a
		print(c)
	else:
		print(0)


t = int(input())
while t:
	t -= 1
	(a, b) = list(map(int, input().split()))
	diff = abs(a - b)
	ct = diff / 10
	diff = diff % 10
	if diff > 0:
		ct += 1
	print(int(ct))


def find(a, b):
	if a == b:
		return 0
	val = abs(a - b)
	ans = val % 10
	q = val // 10
	if ans == 0:
		return q
	return q + 1
t = int(input())
while t > 0:
	(a, b) = map(int, input().split())
	print(find(a, b))
	t -= 1


import sys

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

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

def input():
	return sys.stdin.readline().strip()
for _ in range(int(input())):
	(a, b) = get_ints()
	if a == b:
		print(0)
		continue
	if b > a:
		x = (b - a) // 10
		if (b - a) % 10 != 0:
			x += 1
		print(x)
	if a > b:
		(a, b) = (b, a)
		x = (b - a) // 10
		if (b - a) % 10 != 0:
			x += 1
		print(x)


for _ in range(int(input())):
	l = [int(x) for x in input().split(' ')]
	m = max(l)
	n = min(l)
	floor = (m - n - 1) // 10 + 1
	print(floor)


import math

def dtb(n):
	return bin(n).replace('0b', '')

def btd(n):
	return int(n, 2)
t = int(input())
for k in range(t):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
		continue
	x = abs(a - b)
	if x % 10 == 0:
		print(x // 10)
	else:
		print(x // 10 + 1)


t = int(input())
for t in range(t):
	(p, q) = map(int, input().split())
	p1 = abs(q - p)
	x = p1 // 10
	if p1 % 10 != 0:
		print(x + 1)
	else:
		print(x)


t = int(input())
y = t
list1 = []
while t != 0:
	(a, b) = [int(x) for x in input().split()]
	c = abs(a - b)
	sol = int(c / 10)
	if c % 10 == 0:
		list1.append(sol)
	else:
		list1.append(sol + 1)
	t = t - 1
for i in list1:
	print(i)


def countSteps(a, b):
	if a == b:
		return 0
	mx = max(a, b)
	mn = min(a, b)
	count = 0
	dif = mx - mn
	if dif % 10 == 0:
		return int((mx - mn) / 10)
	else:
		return int((mx - mn) / 10) + 1
count = int(input())
for i in range(count):
	(a, b) = input().split(' ')
	a = int(a)
	b = int(b)
	print(countSteps(a, b))


for i in range(int(input())):
	(a, b) = map(int, input().split())
	if b == a:
		print(0)
	elif b > a:
		answer = 0
		k = (b - a) // 10
		b -= k * 10
		if b == a:
			answer += k
		else:
			answer += k + 1
		print(answer)
	else:
		answer = 0
		k = (a - b) // 10
		b += k * 10
		if b == a:
			answer += k
		else:
			answer += k + 1
		print(answer)


import math
for i1 in range(int(input())):
	(a, b) = map(int, input().split())
	x = abs(a - b)
	y = math.ceil(x / 10)
	print(y)


import math
import sys
t = int(input())
for cs in range(t):
	(a, b) = map(int, input().split())
	d = abs(a - b)
	ans = (d + 9) // 10
	print(ans)


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	d = abs(a - b)
	ans = (d - 1) // 10 + 1
	print(ans)


import math
from collections import deque
from sys import stdin, stdout
from string import ascii_letters
import sys
letters = ascii_letters
input = stdin.readline
for i in range(int(input())):
	(a, b) = list(map(int, input().split()))
	print(abs(a - b) // 10 + (1 if abs(a - b) % 10 != 0 else 0))


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	ans = 0
	sub = abs(a - b)
	rem = sub % 10
	ans = sub // 10
	if rem > 0:
		ans += 1
	print(ans)


import sys, bisect, string, math, time, functools, random, fractions
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
from itertools import permutations, combinations, groupby
rep = range
R = range

def Golf():
	(n, *t) = map(int, open(0).read().split())

def I():
	return int(input())

def S_():
	return input()

def IS():
	return input().split()

def LS():
	return [i for i in input().split()]

def MI():
	return map(int, input().split())

def LI():
	return [int(i) for i in input().split()]

def LI_():
	return [int(i) - 1 for i in input().split()]

def NI(n):
	return [int(input()) for i in range(n)]

def NI_(n):
	return [int(input()) - 1 for i in range(n)]

def NLI(n):
	return [[int(i) for i in input().split()] for i in range(n)]

def NLI_(n):
	return [[int(i) - 1 for i in input().split()] for i in range(n)]

def StoLI():
	return [ord(i) - 97 for i in input()]

def ItoS(n):
	return chr(n + 97)

def LtoS(ls):
	return ''.join([chr(i + 97) for i in ls])

def RA():
	return map(int, open(0).read().split())

def RLI(n=8, a=1, b=10):
	return [random.randint(a, b) for i in range(n)]

def RI(a=1, b=10):
	return random.randint(a, b)

def Rtest(T):
	(case, err) = (0, 0)
	for i in range(T):
		inp = INP()
		(a1, ls) = naive(*inp)
		a2 = solve(*inp)
		if a1 != a2:
			print((a1, a2), inp)
			err += 1
		case += 1
	print('Tested', case, 'case with', err, 'errors')

def GI(V, E, ls=None, Directed=False, index=1):
	org_inp = []
	g = [[] for i in range(V)]
	FromStdin = True if ls == None else False
	for i in range(E):
		if FromStdin:
			inp = LI()
			org_inp.append(inp)
		else:
			inp = ls[i]
		if len(inp) == 2:
			(a, b) = inp
			c = 1
		else:
			(a, b, c) = inp
		if index == 1:
			a -= 1
			b -= 1
		aa = (a, c)
		bb = (b, c)
		g[a].append(bb)
		if not Directed:
			g[b].append(aa)
	return (g, org_inp)

def GGI(h, w, search=None, replacement_of_found='.', mp_def={'#': 1, '.': 0}, boundary=1):
	mp = [boundary] * (w + 2)
	found = {}
	for i in R(h):
		s = input()
		for char in search:
			if char in s:
				found[char] = (i + 1) * (w + 2) + s.index(char) + 1
				mp_def[char] = mp_def[replacement_of_found]
		mp += [boundary] + [mp_def[j] for j in s] + [boundary]
	mp += [boundary] * (w + 2)
	return (h + 2, w + 2, mp, found)

def TI(n):
	return GI(n, n - 1)

def accum(ls):
	rt = [0]
	for i in ls:
		rt += [rt[-1] + i]
	return rt

def bit_combination(n, base=2):
	rt = []
	for tb in R(base ** n):
		s = [tb // base ** bt % base for bt in R(n)]
		rt += [s]
	return rt

def gcd(x, y):
	if y == 0:
		return x
	if x % y == 0:
		return y
	while x % y != 0:
		(x, y) = (y, x % y)
	return y

def YN(x):
	print(['NO', 'YES'][x])

def Yn(x):
	print(['No', 'Yes'][x])

def show(*inp, end='\n'):
	if show_flg:
		print(*inp, end=end)
mo = 10 ** 9 + 7
inf = float('inf')
FourNb = [(-1, 0), (1, 0), (0, 1), (0, -1)]
EightNb = [(-1, 0), (1, 0), (0, 1), (0, -1), (1, 1), (-1, -1), (1, -1), (-1, 1)]
compas = dict(zip('WENS', FourNb))
cursol = dict(zip('LRUD', FourNb))
l_alp = string.ascii_lowercase
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
input = lambda : sys.stdin.readline().rstrip()
show_flg = False
show_flg = True
ans = 0
for _ in range(I()):
	ans = 0
	(a, b) = LI()
	x = abs(b - a)
	ans = (x + 9) // 10
	print(ans)


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	k = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
	if a == b:
		print(0)
	else:
		c = 0
		m = abs(a - b)
		if m in k:
			print(1)
		else:
			for i in reversed(k):
				e = m // i
				l = m % i
				if l == 0:
					print(c + e)
					break
				if l in k:
					c += e + 1
					print(c)
					break
				else:
					c += e
					m = l


import sys
import math
from _collections import defaultdict
input = sys.stdin.readline
t = int(input())

def inar():
	return [int(el) for el in input().split()]
for _ in range(t):
	(a, b) = inar()
	take = max(a, b) - min(a, b)
	print(math.ceil(take / 10))


testcase = int(input())
l = []
for i in range(testcase):
	(a, b) = map(int, input().split())
	l.append((a, b))
for j in l:
	(a, b) = j
	count = 0
	if a - b == 0:
		count = 0
	elif abs(a - b) in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]:
		count = 1
	elif b < a:
		if a - b not in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]:
			count = count + (a - b) // 10
			b = abs(a - b) % 10
			if b in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]:
				count += 1
	elif b > a:
		if b - a not in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]:
			count = count + (b - a) // 10
			b = abs(a - b) % 10
			if b in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]:
				count += 1
	else:
		pass
	print(count)


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split(' '))
	d = abs(a - b)
	if d == 0:
		print(0)
	elif d <= 10 and d > 0:
		print(1)
	else:
		nd = d
		c = 0
		while nd > 10:
			a = nd // 10
			c = c + a
			nd = nd % 10
		if nd > 0:
			print(c + 1)
		else:
			print(c)


from sys import stdin
import math
for _ in range(int(input())):
	(n, k) = map(int, stdin.readline().rstrip().split(' '))
	print(math.ceil(abs(n - k) / 10))


testcase = int(input())
for i in range(testcase):
	arr = [int(i) for i in input().split()]
	a = arr[0]
	b = arr[1]
	count = 0
	c = abs(a - b)
	d = c // 10
	rem = c % 10
	if rem > 0:
		d += 1
	print(d)


for i in range(int(input())):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
		continue
	if b <= 10 and a <= 10:
		print(1)
		continue
	val = abs(b - a)
	check = val % 10
	if check == 0:
		print(val // 10)
	else:
		print(val // 10 + 1)


t = int(input())
for tc in range(1, t + 1):
	(a, b) = map(int, input().split())
	c = 0
	if a == b:
		print(0)
		continue
	if a > b:
		(a, b) = (b, a)
	diff = b - a
	c = diff // 10
	if diff % 10:
		c += 1
	print(c)


def _solve(a, b):
	ans = 0
	if a == b:
		return 0
	d = abs(a - b)
	i = 10
	while i > 0 and d != 0:
		if d >= i:
			temp = d // i
			ans += temp
			d -= i * temp
		i = i - 1
	return ans
t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	print(_solve(a, b))


for i in range(int(input())):
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	raw_res = abs(a - b) // 10
	if a - raw_res * 10 == b or a + raw_res * 10 == b:
		print(raw_res)
	else:
		print(raw_res + 1)


from sys import stdin, stdout

def input():
	a = stdin.readline()
	if a[-1] == '\n':
		a = a[:-1]
	return a

def print(*argv, end='\n', sep=' '):
	n = len(argv)
	for i in range(n):
		if i == n - 1:
			stdout.write(str(argv[i]))
		else:
			stdout.write(str(argv[i]) + sep)
	stdout.write(end)
mod = 10 ** 9 + 7

def lcm(x, y):
	from math import gcd
	return x * y / gcd(x, y)

def comb(lst, x):
	from itertools import combination as c
	return list(comb(lst, x))

def fact(x, mod=mod):
	ans = 1
	for i in range(1, x + 1):
		ans = ans * i % mod
	return ans

def arr2D(n, m, default=0):
	lst = []
	for i in range(n):
		temp = [default] * m
		lst.append(temp)
	return lst

def sortDictV(x):
	return {k: v for (k, v) in sorted(x.items(), key=lambda item: item[1])}
from math import ceil

def solve(a, b):
	return ceil(abs(a - b) / 10)
for _ in range(int(input())):
	(a, b) = list(map(int, input().split()))
	print(solve(a, b))


from math import ceil
t = int(input().strip())
for a0 in range(t):
	(a, b) = map(int, input().strip().split())
	print(ceil(abs(a - b) / 10))


t = input()
for i in range(int(t)):
	moves = 0
	(a, b) = input().split(' ')
	a = int(a)
	b = int(b)
	if b - a >= 0:
		diff = b - a
	else:
		diff = a - b
	for r in range(10, 0, -1):
		moves += int(diff / r)
		diff = diff % r
		if diff == 0:
			break
	print(moves)


def read_array():
	x = []
	x1 = []
	x = input()
	x = x.split(' ')
	for r in range(len(x)):
		x1.append(int(x[r]))
	return x1

def find_closer_value(a, b):
	count = 0
	if a == b:
		return 0
	if a > b:
		if a > b and a - 10 > b:
			c = (a - b) // 10
			if (a - b) % 10 == 0:
				count += c
			else:
				count += c + 1
		else:
			count += 1
	elif a < b and a + 10 < b:
		c = (b - a) // 10
		if (b - a) % 10 == 0:
			count += c
		else:
			count += c + 1
	else:
		count += 1
	return count
res = []
m = int(input())
for r in range(m):
	x = read_array()
	res.append(find_closer_value(x[0], x[1]))
for v in res:
	print(v)


class Solution:

	def solve(self, a, b):
		if a == b:
			return 0
		return (abs(a - b) + 9) // 10
A = Solution()
T = int(input())
for _ in range(T):
	(a, b) = map(int, input().split())
	print(A.solve(a, b))


t = int(input())
for _ in range(t):
	(a, b) = list(map(int, input().split()))
	diff = abs(a - b)
	plus_10 = diff // 10
	print(plus_10 + (diff != 10 * plus_10))


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	c = 0
	while a != b:
		if a < b:
			dif = b - a
			if dif >= 10:
				k = dif // 10
				a += 10 * k
				c += k
			else:
				a += dif
				c += 1
		else:
			dif = a - b
			if dif >= 10:
				k = dif // 10
				a = a - 10 * k
				c += k
			else:
				a -= dif
				c += 1
	print(c)


import math
numQuery = int(input())
for i in range(numQuery):
	numbers = list(map(int, input().split()))
	a = numbers[0]
	b = numbers[1]
	diff = abs(a - b)
	print(math.ceil(diff / 10))


import sys
import math
tests = int(input())
for i in range(tests):
	(a, b) = [int(i) for i in input().split()]
	diff = abs(a - b)
	moves = 0
	for i in range(10, 0, -1):
		move = diff // i
		moves += move
		diff -= move * i
		if diff == 0:
			break
	print(moves)


import math as mt
import sys, string
from collections import Counter, defaultdict
input = sys.stdin.readline
I = lambda : int(input())
M = lambda : map(int, input().split())
ARR = lambda : list(map(int, input().split()))

def main():
	(a, b) = M()
	diff = abs(a - b)
	if diff % 10 == 0:
		print(diff // 10)
	else:
		print(diff // 10 + 1)
tc = I()
for _ in range(tc):
	main()


def numbers(a, b):
	return (abs(a - b) + 9) // 10
t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	print(numbers(a, b))


import sys
mod = 10 ** 9 + 7
INF = float('inf')

def inp():
	return int(sys.stdin.readline())

def inpl():
	return list(map(int, sys.stdin.readline().split()))
for _ in range(inp()):
	(a, b) = inpl()
	(a, b) = (max(a, b), min(a, b))
	print((a - b + 9) // 10)


test = int(input())
for t in range(test):
	(a, b) = map(int, input().split())
	k = abs(a - b)
	if k == 0:
		print(0)
	elif k % 10 == 0:
		print(k // 10)
	else:
		print(k // 10 + 1)


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(a, b) = [int(i) for i in input().split()]
	ans = abs(b - a) // 10 + ((b - a) % 10 != 0)
	print(ans)


def diffrence(a, b):
	a = abs(b - a)
	if a <= 10:
		if a == 0:
			result = 0
		else:
			result = 1
	else:
		result = a // 10
		if a % 10 == 0:
			result += 0
		else:
			result += 1
	return result
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	print(diffrence(a, b))


t = int(input())
l = []
while t != 0:
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	if abs(b - a) == 0:
		print(0)
	elif abs(b - a) % 10 == 0:
		print(abs(b - a) // 10)
	else:
		print(abs(b - a) // 10 + 1)
	t -= 1
for i in range(len(l)):
	print(l[i])


n = int(input())
for i in range(1, n + 1):
	(a, b) = map(int, input().split())
	if a == b:
		print('0')
	elif a == 0 and b != 0 and (b <= 10):
		print('1')
	elif b == 0 and a != 0 and (a <= 10):
		print('1')
	else:
		m = a - b
		if m < 0:
			m = -m
		x = m
		m = m // 10
		if m != 0 and x % 10 == 0:
			print(m)
		else:
			print(m + 1)


for i in range(int(input())):
	(a, b) = map(int, input().split())
	k = abs(a - b)
	move = k // 10
	if k % 10:
		move += 1
	print(move)


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	val = abs(a - b)
	moves = val // 10 + min(val % 10, 1)
	print(moves)


t = int(input())
answer = []
for t in range(t):
	(a, b) = list(map(int, input().split(' ')))
	difference = abs(a - b)
	answer.append(str(difference // 10 + (difference % 10 > 0) * 1))
print('\n'.join(answer))


t = int(input())
while t:
	t -= 1
	(a, b) = map(int, input().split())
	s = abs(a - b) // 10
	if (a - b) % 10 != 0:
		s += 1
	print(s)


import sys
sys.setrecursionlimit(10 ** 6)
fastinput = sys.stdin.readline
fastoutput = sys.stdout.write
for t in range(int(input())):
	(a, b) = map(int, input().split())
	c = abs(b - a)
	if c % 10 == 0:
		print(c // 10)
	else:
		print(c // 10 + 1)


t = int(input())
while t > 0:
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	else:
		sum = abs(a - b)
		r = sum % 10
		di = sum // 10
		if r == 0:
			print(di)
		else:
			print(di + 1)
	t -= 1


def main():
	t = int(input())
	data = []
	for i in range(t):
		data.append(list(map(int, input().split())))
	for i in range(t):
		x = abs(data[i][0] - data[i][1])
		rem = x % 10
		if rem > 0:
			rem = 1
		if x == 0:
			print(0)
		else:
			print(rem + x // 10)
main()


from sys import stdin, stdout
import math
t = int(stdin.readline())
for _ in range(t):
	(a, b) = map(int, stdin.readline().split())
	val = abs(a - b)
	movs = 0
	if val == 0:
		print(0)
	elif val % 10 == 0:
		print(val // 10)
	else:
		print(val // 10 + 1)


for num in range(int(input())):
	inp = list(map(int, input().split()))
	if abs(inp[0] - inp[1]) % 10 == 0:
		print(int(abs(inp[0] - inp[1]) / 10))
	else:
		print(int(abs(inp[0] - inp[1]) / 10) + 1)


t = int(input())
answer = []
for a in range(t):
	line = input().split()
	a = int(line[0])
	b = int(line[1])
	if a == b:
		answer.append(0)
	else:
		ans = 0
		if abs(a - b) % 10 == 0:
			ans = abs(a - b) // 10
		else:
			ans = abs(a - b) // 10
			ans += 1
		answer.append(ans)
for b in answer:
	print(str(b))


T = int(input())
for t in range(T):
	(n, m) = map(int, input().split())
	print((not abs(n - m) % 10 == 0) + abs(n - m) // 10)


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	l = 0
	r = max(a, b)

	def ok(m):
		global a, b
		if a < b:
			if a + m * 10 >= b:
				return False
			else:
				return True
		elif a > b:
			if a - m * 10 <= b:
				return False
			else:
				return True
	while r - l > 1:
		m = (r + l) // 2
		if ok(m):
			l = m
		else:
			r = m
	if a != b:
		print(l + 1)
	else:
		print(0)


from sys import stdin, stdout
cases = int(stdin.readline())
for i in range(cases):
	ans = 0
	(a, b) = map(int, stdin.readline().split())
	k = abs(a - b)
	ans = k // 10
	if k % 10 != 0:
		ans += 1
	stdout.write(str(ans) + '\n')


for j in range(int(input())):
	(a, b) = map(int, input().split())
	c = abs(b - a)
	l = c // 10
	if c % 10 != 0:
		l += 1
	print(l)


t = int(input())
for i in range(t):
	count = 0
	ab = input().split()
	a = int(ab[0])
	b = int(ab[1])
	if a == b:
		print(0)
		continue
	elif a < b:
		k = b - a
	else:
		k = a - b
	count = k / 10
	if k % 10 != 0:
		count += 1
	print(int(count))


for i in range(int(input())):
	(a, b) = map(int, input().split())
	p = abs(b - a)
	f = p // 10
	g = p % 10
	if g != 0:
		g = 1
	print(abs(f) + g)


try:
	t = int(input())
	while t != 0:
		(a, b) = map(int, input().split())
		p = abs(b - a)
		if p % 10 == 0:
			print(p // 10)
		else:
			print(p // 10 + 1)
		t = t - 1
except EOFError:
	print(' ')


from sys import stdin, stdout, setrecursionlimit
import heapq
from math import gcd, ceil, sqrt
from collections import Counter, deque
from bisect import bisect_left, bisect_right
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()
setrecursionlimit(100000)
mod = 1000000007
tc = ii1()
for _ in range(tc):
	(a, b) = iia()
	diff = abs(a - b)
	res = diff // 10
	if diff % 10:
		res += 1
	print(res)


def integers(a, b):
	n = 10
	count = 0
	if a != b:
		diff = abs(a - b)
		while n > 0:
			count += diff // n
			diff = diff % n
			n -= 1
			if diff == 0:
				return count
	else:
		return 0

def main():
	res = []
	for _ in range(int(input())):
		(a, b) = map(int, input().split())
		res.append(integers(a, b))
	for i in res:
		print(i)
main()


def ans(a, b):
	k = abs(a - b)
	temp = k % 10
	ans = k // 10
	return ans + 1 if temp > 0 else ans
T = int(input())
for i in range(T):
	(a, b) = map(int, input().strip().split(' '))
	print(ans(a, b))


T = int(input())
for i in range(0, T):
	(a, b) = map(int, input().split())
	print((abs(a - b) + 9) // 10)


import sys, os, io

def rs():
	return sys.stdin.readline().rstrip()

def ri():
	return int(sys.stdin.readline())

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

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math, datetime, functools, itertools, operator, bisect, fractions
from collections import deque, defaultdict, OrderedDict
from fractions import Fraction
from decimal import Decimal

def main():
	starttime = datetime.datetime.now()
	if os.path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	for _ in range(ri()):
		(a, b) = ria()
		c = abs(a - b)
		ans = c // 10
		if c % 10 != 0:
			ans += 1
		print(ans)
	endtime = datetime.datetime.now()
	time = (endtime - starttime).total_seconds() * 1000
	if os.path.exists('input.txt'):
		print('Time:', time, 'ms')

class FastReader(io.IOBase):
	newlines = 0

	def __init__(self, fd, chunk_size=1024 * 8):
		self._fd = fd
		self._chunk_size = chunk_size
		self.buffer = io.BytesIO()

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self, size=-1):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size if size == -1 else size))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

class FastWriter(io.IOBase):

	def __init__(self, fd):
		self._fd = fd
		self.buffer = io.BytesIO()
		self.write = self.buffer.write

	def flush(self):
		os.write(self._fd, self.buffer.getvalue())
		(self.buffer.truncate(0), self.buffer.seek(0))

class FastStdin(io.IOBase):

	def __init__(self, fd=0):
		self.buffer = FastReader(fd)
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

class FastStdout(io.IOBase):

	def __init__(self, fd=1):
		self.buffer = FastWriter(fd)
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.flush = self.buffer.flush
sys.stdin = FastStdin()
sys.stdout = FastStdout()
main()


def Solve(a, b):
	if a == b:
		return 0
	k = abs(a - b)
	return k // 10 if k % 10 == 0 else k // 10 + 1
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	print(Solve(a, b))


def my_fun(c):
	cc = 0
	if c % 10 == 0:
		c = int(c // 10)
		cc = c
	else:
		c = int(c // 10)
		cc = c + 1
	return cc
t = int(input())
while t > 0:
	t -= 1
	(a, b) = input().split()
	aa = int(a)
	bb = int(b)
	c = 0
	diff = 0
	cc = 0
	vv = 0
	if aa == bb:
		print(0)
	else:
		if aa > bb:
			c = aa - bb
			vv = my_fun(c)
		elif bb > aa:
			c = bb - aa
			vv = my_fun(c)
		print(vv)


t = int(input())
res = []
for i in range(t):
	l = list(map(int, input().split()))
	d = abs(l[1] - l[0])
	if d % 10 == 0:
		n = d // 10
	else:
		n = d // 10 + 1
	res.append(n)
for i in res:
	print(i)


from math import ceil

def solve():
	(a, b) = map(int, input().split())
	print(ceil(abs(a - b) / 10))
t = int(input())
for i in range(t):
	solve()


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	moves = 0
	if a != b:
		diff = abs(a - b)
		moves = (diff + 9) // 10
	print(moves)


from collections import Counter, defaultdict, deque
import sys
input = sys.stdin.readline

def solve():
	(a, b) = [int(x) for x in input().split()]
	ans = abs(b - a)
	print((ans % 10 != 0) + ans // 10)
tt = int(input())
for test in range(tt):
	solve()


t = int(input())
answers = []
for i in range(t):
	l = [int(x) for x in input().split()]
	(a, b) = l
	x = abs(b - a)
	ctr = 0
	while x:
		for j in range(10, 0, -1):
			if x != 0:
				ctr += x // j
			x -= x // j * j
	answers.append(ctr)
for a in answers:
	print(a)


t = int(input())
for _ in range(t):
	(a, b) = tuple(map(int, input().split()))
	x = abs(b - a)
	q = x // 10
	r = x % 10
	if r == 0:
		print(q)
	else:
		print(q + 1)


from math import ceil
t = int(input())
while t > 0:
	t = t - 1
	_ = input().split()
	a = int(_[0])
	b = int(_[1])
	print(ceil(abs(a - b) / 10))


def countmany(n):
	l = [list(map(int, input().split(' '))) for _ in range(n)]
	for i in l:
		print((abs(i[0] - i[1]) + 9) // 10)
n = input()
countmany(int(n))


t = int(input())
for i in range(1, t + 1):
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	q = abs(a - b)
	dem = 0
	so10 = q // 10
	q = q % 10
	dem = dem + so10
	if q != 0:
		dem = dem + 1
	print(dem)


t = int(input())
for _ in range(t):
	(a, b) = list(map(int, input().split()))
	diff = abs(a - b)
	temp = diff // 10
	temp_1 = diff % 10
	if temp_1 == 0:
		print(temp)
	else:
		print(temp + 1)


testCase = int(input())
while testCase != 0:
	testCase -= 1
	(a, b) = [int(x) for x in input().split()]
	difference = abs(a - b)
	result = int(difference / 10)
	if difference % 10 != 0:
		result += 1
	print(result)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
		continue
	if a > b:
		(b, a) = (a, b)
	target = b - a
	if target <= 10 and target >= 1:
		print(1)
		continue
	elif target % 10 == 0:
		print(target // 10)
	else:
		print(target // 10 + 1)


from math import ceil
n = int(input())
for i in range(n):
	line = input().split(' ')
	a = int(line[0])
	b = int(line[1])
	m = abs(a - b)
	print(ceil(m / 10.0))


from sys import stdin, stdout
from collections import Counter
from itertools import permutations
import bisect
import math
I = lambda : map(int, stdin.readline().split())
I1 = lambda : stdin.readline()
for _ in range(int(I1())):
	(a, b) = I()
	c = abs(a - b)
	if c % 10 == 0:
		print(c // 10)
	else:
		print(c // 10 + 1)


import math
for tc in range(int(input())):
	nx = list(map(int, input().split()))
	n = nx[0]
	x = nx[1]
	print(math.ceil(abs(n - x) / 10))


import sys
import math
import collections
import heapq
import queue
import itertools
import functools
import operator
import time
readline = sys.stdin.readline
IPS = lambda : readline().rstrip()
IP = lambda : int(readline().rstrip())
MP = lambda : map(int, readline().split())
LS = lambda : list(map(int, readline().split()))

def solve():
	for _ in range(IP()):
		(a, b) = MP()
		mx = abs(a - b)
		ans = int(mx / 10)
		if mx % 10 != 0:
			ans += 1
		print(ans)
solve()


from math import ceil
from collections import deque
for _ in range(int(input())):
	(a, b) = [int(i) for i in input().split()]
	print(ceil(abs(b - a) / 10))


t = int(input())
while t:
	user_input = list(map(int, input().split()))
	if user_input[0] == user_input[1]:
		print(0)
		t -= 1
		continue
	elif user_input[0] < user_input[1]:
		target = user_input[1] - user_input[0]
	else:
		target = user_input[0] - user_input[1]
	if target <= 10:
		print(1)
	else:
		solution = 0
		while target:
			rem = target % 10
			solution = solution + target // 10
			target = rem
			if target == 0:
				print(solution)
				break
			elif target <= 10:
				print(solution + 1)
				break
	t -= 1


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	(ten, num) = divmod(abs(a - b), 10)
	print(ten + bool(num))


test_cases = int(input())
for test_case in range(test_cases):
	(a, b) = list(map(int, input().split()))
	diff = abs(a - b)
	ans = diff // 10
	if diff == 0:
		ans = 0
	elif ans == 0 and diff != 0:
		ans = 1
	elif ans * 10 < diff:
		ans += 1
	print(ans)


t = int(input(''))
arr = []
for i in range(t):
	arr.append(list(map(int, input().split())))
for i in arr:
	a = i[0]
	b = i[1]
	diff = abs(b - a)
	sol = diff / 10
	if sol == int(sol):
		print(int(sol))
	else:
		print(int(sol) + 1)


import math
test = int(input())
for _ in range(test):
	(a, b) = map(int, input().split())
	diff = abs(a - b)
	value = math.ceil(diff / 10)
	print(value)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	diff = abs(b - a)
	op = 0
	i = 10
	while diff and i:
		op += diff // i
		diff = diff % i
		i -= 1
	print(op)


import math
for _ in range(int(input())):
	(m, n) = sorted(list(map(int, input().split())))
	if m == n:
		print(0)
	else:
		print(math.ceil((n - m) / 10))


t = int(input())
from math import ceil
for _ in range(t):
	a = list(map(int, input().split()))
	print(ceil(abs(a[0] - a[1]) / 10))


import math
numab = []
for i in range(int(input())):
	numab.append(input().split(' '))
for i in numab:
	a = int(i[0])
	b = int(i[1])
	max1 = b
	min1 = a
	if a > b:
		max1 = a
		min1 = b
	if max1 - min1 == 0:
		print(0)
	else:
		print(math.ceil((max1 - min1) / 10))


x = []
a = int(input())
for i in range(0, a):
	(c, d) = map(int, input().split(' '))
	if c > d:
		n = d
		d = c
		c = n
	if d - c == 0:
		x.append(0)
	if int(d) - int(c) != 0:
		e = d - c
		f = int(e / 10)
		if e % 10 > 0:
			f = f + 1
		x.append(f)
for i in range(0, len(x)):
	print(x[i])


import collections
from functools import lru_cache
import bisect
INF = float('inf')
NEG_INF = float('inf')
ZERO = 0
ONE = 1

def read():
	return input().strip()

def readInt():
	return int(input().strip())

def readList():
	return list(map(int, input().strip().split()))

def solve(a, b):
	diff = abs(a - b)
	return diff // 10 + int(diff % 10 != 0)
t = readInt()
for i in range(t):
	(a, b) = readList()
	print(solve(a, b))


def Input():
	Str = input('')
	List = Str.split(' ')
	for i in range(len(List)):
		List[i] = int(List[i])
	return List

def Function(a, b):
	Count = 0
	N = abs(a - b) / 10
	Count += int(N)
	if N != int(N):
		Count += 1
	return Count
trials = int(input(''))
for i in range(trials):
	[a, b] = Input()
	print(Function(a, b))


t = int(input())
r = 0
while r < t:
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	if a > b:
		if (a - b) % 10 == 0:
			print((a - b) // 10)
		else:
			print((a - b) // 10 + 1)
	elif (b - a) % 10 == 0:
		print((b - a) // 10)
	else:
		print((b - a) // 10 + 1)
	r = r + 1


try:
	t = int(input())
	for i in range(t):
		(a, b) = map(int, input().split())
		c = abs(a - b)
		d = c // 10
		if c % 10 > 0:
			d += 1
		print(d)
except:
	pass


a = int(input())
for i in range(a):
	(b, c) = map(int, input().split())
	dist = abs(b - c)
	if b == c:
		print('0')
	else:
		print((dist + 9) // 10)


for i in range(int(input())):
	(a, b) = map(int, input().split())
	k = abs(a - b)
	c = 0
	i = 10
	while k > 0:
		c += int(k / i)
		k = k % i
		i -= 1
	print(c)


t = int(input())
ans = []
for k in range(t):
	(a, b) = map(int, input().split())
	d = abs(b - a)
	q = d // 10
	if d % 10 == 0:
		y = 0
	else:
		y = 1
	ans.append(q + y)
for i in ans:
	print(i)


from math import *
sInt = lambda : int(input())
mInt = lambda : map(int, input().split())
lInt = lambda : list(map(int, input().split()))
t = sInt()
for _ in range(t):
	(a, b) = mInt()
	if abs(b - a) % 10 == 0:
		print(abs(b - a) // 10)
	else:
		print(abs(b - a) // 10 + 1)


import io
import os
from collections import Counter, defaultdict, deque

def solve(A, B):
	diff = abs(A - B)
	if diff == 0:
		return 0
	return (diff + 9) // 10
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
TC = int(input())
for tc in range(1, TC + 1):
	(A, B) = [int(x) for x in input().split()]
	ans = solve(A, B)
	print(ans)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
		continue
	abss = max(a, b) - min(a, b)
	moves = abss // 10
	if abss % 10 != 0:
		moves += 1
	print(moves)


def Integers(a, b):
	diff = abs(a - b)
	d = diff // 10
	rem = diff % 10
	if rem != 0:
		d += 1
	return d
t = int(input())
for i in range(t):
	(a, b) = tuple(map(int, input().split()))
	print(Integers(a, b))


t = int(input())
while t > 0:
	(n, m) = input().split()
	a = int(n)
	b = int(m)
	k = 10
	ans = 0
	a = abs(b - a)
	while a > 0:
		p = a // k
		a = a % k
		if p == 0:
			k -= 1
		else:
			ans += p
	print(ans)
	t -= 1


import math
t = int(input())
while t > 0:
	(a, b) = map(int, input().split())
	diff = abs(a - b)
	ans = diff // 10
	if diff % 10 != 0:
		ans += 1
	print(ans)
	t -= 1


cases = int(input())
for i in range(cases):
	(a, b) = map(int, input().split())
	dif = abs(a - b)
	q = int(dif / 10)
	d = dif % 10
	if d == 0:
		print(q)
	else:
		print(q + 1)


n = int(input())
p = []
for i in range(n):
	(a, b) = map(int, input().split())
	S = abs(a - b)
	if S % 10 == 0:
		p.append(str(S // 10))
	else:
		p.append(str(S // 10 + 1))
print('\n'.join(p))


for _ in ' ' * int(input()):
	(a, b) = map(int, input().split())
	z = abs(a - b)
	s = 0
	for i in range(10, 0, -1):
		if z:
			k = z // i
			s += k
			z -= k * i
	print(s)


import math, sys
from collections import defaultdict, Counter, deque
INF = float('inf')
MOD = 10 ** 9 + 7

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

def isPrime(n):
	if n <= 1:
		return False
	i = 2
	while i ** 2 <= n:
		if n % i == 0:
			return False
		i += 1
	return True

def primeFactors(n):
	factors = defaultdict(int)
	i = 2
	while i ** 2 <= n:
		while n % i == 0:
			factors[i] += 1
			n //= i
		i += 1
	if n > 1:
		factors[n] += 1
	return factors

def vars():
	return map(int, input().split())

def array():
	return list(map(int, input().split()))

def a():
	(a, b) = map(int, input().split())
	ans = math.ceil(abs(b - a) / 10)
	print(ans)

def b():
	(a, b, x, y, n) = vars()
	(n1, n2) = (n, n)
	a1 = a - min(a - x, n)
	b2 = b - min(b - y, n)
	n1 -= a - a1
	n2 -= b - b2
	b1 = b - min(b - y, n1)
	a2 = a - min(a - x, n2)
	print(min(a1 * b1, a2 * b2))

def c():
	(n, x, y) = vars()
	diff = None
	ans = None
	for d in range(1, y - x + 1):
		arr = []
		num = x
		while num <= y:
			arr.append(num)
			num += d
		if len(arr) <= n and x in arr and (y in arr):
			diff = d
			break
	for start in range(1, x + 1):
		ans = []
		num = start
		for i in range(n):
			ans.append(num)
			num += diff
		if x in ans and y in ans:
			print(*ans)
			return
t = 1
t = int(input())
for _ in range(t):
	a()


def two_int(a, b):
	if a == b:
		return 0
	s = max(a, b) - min(a, b)
	t = s // 10
	rem = s % 10
	if rem:
		ans = t + 1
	else:
		ans = t
	return ans
t = int(input())
for _ in range(t):
	ab = input().split()
	a = int(ab[0])
	b = int(ab[1])
	print(two_int(a, b))


import sys

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

def Strs():
	return map(str, sys.stdin.readline().strip().split())

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

def Str():
	return sys.stdin.readline().strip()

def Int():
	return int(sys.stdin.readline().strip())

def MOD():
	return 1000000007

def power(base, power):
	MOD = 1000000007
	result = 1
	while power > 0:
		if power % 2 == 1:
			result = result * base % MOD
		power = power // 2
		base = base * base % MOD
	return result
t = Int()
while t:
	t -= 1
	(a, b) = Ints()
	if a > b:
		(a, b) = (b, a)
	if a == b:
		print(0)
	else:
		count = 0
		c = b - a
		while c:
			for i in range(1, 11):
				if i > c:
					break
				value = i
			count += c // value
			c %= value
		print(count)


import sys
import math
inputlines = sys.stdin.readlines()
number_of_testcases = int(inputlines[0])
for i in range(number_of_testcases):
	(a, b) = list(map(int, inputlines[i + 1].split(' ')))
	difference = abs(a - b)
	answer = math.ceil(difference / 10)
	print(answer)


def solve():
	(a, b) = map(int, input().split())
	c = max(a, b)
	d = min(a, b)
	diff = c - d
	if diff % 10 == 0:
		print(diff // 10)
	else:
		print(diff // 10 + 1)
for i in range(int(input())):
	solve()


def process():
	(a, b) = map(int, input().split())
	if b > a:
		(a, b) = (b, a)
	(quot, mod) = ((a - b) // 10, (a - b) % 10)
	if mod == 0:
		return quot
	return quot + 1
for i in range(int(input())):
	print(process())


t = input()
t = int(t)
test_time = 0
while True:
	test_time = test_time + 1
	if test_time > t:
		break
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	i = 0
	if a == b:
		print(i)
	else:
		c = abs(b - a)
		if c > 10:
			i = c // 10
			if c % 10 > 0:
				i = i + 1
		else:
			i = i + 1
		print(i)


import math

def num(a, b):
	big = 0
	small = 0
	if a - b > 0:
		big += a
		small += b
	elif a - b < 0:
		big += b
		small += a
	else:
		big += a
		small += b
	rat = math.floor((big - small) / 10)
	if (big - small) % 10 == 0:
		print(rat)
	elif big == small:
		print(0)
	else:
		print(rat + 1)
m = int(input())
for lol in range(1, m + 1):
	(c, d) = input().split()
	num(int(c), int(d))


try:
	for _ in range(int(input())):
		(a, b) = map(int, input().split())
		val = abs(a - b)
		if val == 0:
			print(0)
			continue
		if val <= 10:
			print(1)
			continue
		ans = 0
		ans += int(val / 10)
		if val % 10:
			ans += 1
		print(ans)
except:
	pass


def solve(a, b, ans):
	diff = abs(a - b)
	moves = 0
	for i in range(10, 0, -1):
		moves += diff // i
		diff %= i
	ans.append(str(moves))

def main():
	t = int(input())
	ans = []
	for i in range(t):
		(a, b) = map(int, input().split())
		solve(a, b, ans)
	print('\n'.join(ans))
main()


t = int(input())
for i in range(t):
	(a, b) = tuple(map(int, input().split()))
	print(int(abs(a - b) / 10) + int((a - b) % 10 != 0))


t = int(input())
while t > 0:
	t -= 1
	(a, b) = map(int, input().split())
	if a == b:
		ans = 0
	else:
		l = abs(a - b)
		if l % 10 == 0:
			ans = l // 10
		else:
			ans = l // 10 + 1
	print(ans)


import sys
import math
t = int(sys.stdin.readline())
for i in range(t):
	[a, b] = [int(x) for x in sys.stdin.readline().split()]
	print(math.ceil(abs(a - b) / 10))


t = int(input())
for question in range(t):
	array = list(map(int, input().split()))
	d = abs(array[0] - array[1])
	if d % 10 == 0:
		print(d // 10)
	else:
		print(d // 10 + 1)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	diff = max(a, b) - min(a, b)
	res = diff // 10
	if diff % 10:
		print(res + 1)
	else:
		print(res)


import sys
t = int(input())
for i in range(t):
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	count = 0
	c = abs(b - a)
	d = int(c / 10)
	if c % 10 == 0:
		print(d)
	else:
		print(d + 1)


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	ans = abs(a - b)
	an = 0
	for i in range(10, 0, -1):
		an += ans // i
		ans = ans % i
	print(an)


def minmoves(a, b):
	cnt = 0
	return (abs(a - b) + 9) // 10

def main():
	t = int(input())
	while t > 0:
		(a, b) = map(int, input().split())
		print(minmoves(a, b))
		t = t - 1
main()


n = int(input())
while n != 0:
	n -= 1
	(a, b) = map(int, input().split())
	if a > b:
		t = a
		a = b
		b = t
	cnt = (b - a) // 10
	if (b - a) % 10 != 0:
		cnt += 1
	print(cnt)


import math
import os
import random
import re
import sys
t = int(input())
for x in range(t):
	(a, b) = map(int, input().rstrip().split())
	c = abs(a - b) // 10
	if a == b:
		print('0')
	elif abs(a - b) % 10 == 0:
		print(c)
	else:
		print(c + 1)


for _ in range(int(input())):
	arr1 = [int(i) for i in input().split()]
	if arr1[1] - arr1[0] == 0:
		print(0)
	elif abs(arr1[1] - arr1[0]) % 10 == 0:
		print(abs(arr1[1] - arr1[0]) // 10)
	else:
		print(abs(arr1[1] - arr1[0]) // 10 + 1)


import sys
input = sys.stdin.readline

def solve():
	(a, b) = [int(x) for x in input()[:-1].split()]
	d = abs(a - b)
	res = d // 10
	if d % 10 > 0:
		res += 1
	print(res)

def main():
	T = int(input())
	for _ in range(T):
		solve()
main()


t = int(input())
while t > 0:
	(a, b) = [int(x) for x in input().split()]
	(a, b) = (min(a, b), max(a, b))
	d = b - a
	d1 = d // 10
	x = 0
	if not a % 10 == b % 10:
		x = 1
	print(d1 + x)
	t -= 1


from sys import stdin, stdout
input = stdin.buffer.readline
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	print((abs(a - b) + 9) // 10)


n = int(input())
while n:
	d = c = 0
	int_nos = input()
	ar = int_nos.split()
	d = abs(int(ar[0]) - int(ar[1]))
	c = int(d / 10)
	if d % 10 >= 1:
		c = c + 1
	print(c)
	n = n - 1


import math
import os
import random
import re
import string
from sys import *
from collections import *

def bs(arr, x, l, r):
	if l <= r:
		mid = (r + l) // 2
		if arr[mid] == x:
			return mid
		elif arr[mid] > x:
			return bs(arr, x, l, mid - 1)
		else:
			return bs(arr, x, mid + 1, r)
	else:
		return -1

def solve():
	for _ in range(int(input())):
		(a, b) = map(int, stdin.readline().strip().split())
		d = abs(a - b)
		print(math.ceil(d / 10))
solve()


for _ in range(int(input())):
	(a, b) = map(int, input().strip().split())
	if a == b:
		print('0')
	elif a > b:
		z = a - b
		if z <= 10:
			print('1')
		else:
			s = z // 10
			d = z % 10
			if d == 0:
				print(s)
			else:
				print(s + 1)
	else:
		z = b - a
		if z <= 10:
			print('1')
		else:
			s = z // 10
			d = z % 10
			if d == 0:
				print(s)
			else:
				print(s + 1)


t = int(input())
while t != 0:
	(a, b) = list(map(int, input().split()))
	steps = int(abs(b - a) / 10)
	extra = int(abs(b - a) % 10)
	if extra > 0:
		steps += 1
	print(steps)
	t -= 1


t = int(input())
while t:
	t -= 1
	(a, b) = map(int, input().split())
	nt = abs(b - a)
	if nt == 0:
		print('0')
	else:
		nt1 = nt // 10 + 1
		m = nt % 10
		if m == 0:
			print(nt1 - 1)
		else:
			print(nt1)


from collections import Counter
import math
import sys
from bisect import bisect, bisect_left, bisect_right

def input():
	return sys.stdin.readline().strip()

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def mod():
	return 10 ** 9 + 7
for i in range(INT()):
	(a, b) = MAP()
	ans = math.ceil(abs(a - b) / 10)
	print(ans)


n = int(input())
i = 0
while i < n:
	(a, b) = [int(i) for i in input().split()]
	kol = 0
	if a > b:
		(a, b) = (b, a)
	for j in range(10, 0, -1):
		if (b - a) // j > 0:
			kol += (b - a) // j
			a += (b - a) // j * j
		if a == b:
			break
	print(kol)
	i += 1


def testcase(j):
	steps = 0
	c = 10
	while c > 0 and j != 0:
		steps += int(j / c)
		j = int(j % c)
		c -= 1
	return steps
a = int(input())
strs = []
for i in range(0, a):
	j = input().split(' ')
	if int(j[0]) < int(j[1]):
		strs.append(testcase(int(j[1]) - int(j[0])))
	elif int(j[0]) > int(j[1]):
		strs.append(testcase(int(j[0]) - int(j[1])))
	else:
		strs.append(0)
for i in range(0, a):
	print(strs[i])


mod = 10 ** 9 + 7

def readInt():
	return int(input())

def readIntList():
	return list(map(int, input().split()))

def readStringList():
	return list(input())

def readStringListWithSpace():
	return list(input().split())

def readString():
	return input()
t = readInt()
for _ in range(t):
	(a, b) = readIntList()
	diff = abs(a - b)
	(div, rem) = divmod(diff, 10)
	res = div if not rem else div + 1
	print(res)


def read_ints():
	return map(int, input().split())
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	count = 0
	(whole, rem) = divmod(abs(a - b), 10)
	count += whole
	if rem:
		count += 1
	print(count)


for i in range(int(input())):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	else:
		res = 0
		sub = abs(b - a)
		if sub % 10:
			res = sub // 10 + 1
		else:
			res = sub // 10
		print(res)


n = int(input())

def g(n):
	for _ in range(n):
		x = input()
		y = x.split(' ')
		a = int(y[0])
		b = int(y[1])
		if abs(a - b) // 10 == abs(a - b) / 10:
			print(abs(a - b) // 10)
		else:
			print(abs(a - b) // 10 + 1)
g(n)


import os
import sys
from io import BytesIO, IOBase

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def li():
	return list(mi())

def main():
	t = int(input())
	for _ in range(t):
		(a, b) = mi()
		d = abs(a - b)
		if d % 10 != 0:
			res = d // 10 + 1
		else:
			res = d // 10
		print(res)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


from math import ceil as c
x = int(input())
for i in range(x):
	(a, b) = map(int, input().split())
	print(c((max(a, b) - min(a, b)) / 10))


for _ in range(int(input())):
	lis = list(map(int, input().split()))
	(a, b) = (lis[0], lis[1])
	(a, b) = (min(a, b), max(a, b))
	r = b - a
	s = r // 10
	print(s + (1 if r % 10 != 0 else 0))


def check(a, b):
	if a == b:
		return 0
	x = abs(a - b)
	if x <= 10:
		return 1
	r = x % 10
	x = x // 10
	if r == 0:
		return x
	return x + 1
for _ in range(int(input())):
	(a, b) = map(int, input().split(' '))
	print(check(a, b))


def p0(a, b):
	count = 0
	k = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
	if a == b:
		return count
	if abs(b - a) in k:
		count += 1
		return count
	temp = b
	if abs(b - a) > 10:
		div = abs(b - a) // 10
		count = div
		if abs(b - a) % 10 == 0:
			return count
		else:
			return count + 1
t = int(input())
while t:
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	ans = p0(a, b)
	print(ans)
	t = t - 1


for _ in range(int(input())):
	(a, b) = [int(i) for i in input().split()]
	count = 0
	if a == b:
		print(0)
	else:
		if a > b:
			(a, b) = (b, a)
		razn = b - a
		count += razn // 10
		razn %= 10
		if razn != 0:
			count += 1
		print(count)


import math
for a0 in range(int(input())):
	(a, b) = [int(x) for x in input().split()]
	ans = math.ceil(abs(b - a) / 10)
	print(ans)


t = int(input())
for i in range(0, t):
	ab = input().split()
	a = int(ab[0])
	b = int(ab[1])
	mod = abs(b - a) % 10
	mov = int((abs(b - a) - mod) / 10)
	print(mov + (0 if mod == 0 else 1))


def solve():
	(a, b) = [int(i) for i in input().split()]
	return abs(a - b) // 10 + (1 if abs(a - b) % 10 != 0 else 0)
t = int(input())
ans = []
while t:
	ans.append(str(solve()))
	t -= 1
print('\n'.join(ans))


import math
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	if n > k:
		print(abs(math.ceil((n - k) / 10)))
	else:
		print(abs(math.ceil((k - n) / 10)))


t = int(input())
ccc = []
while t > 0:
	ttt = [int(item) for item in input().split()]
	(a, b) = (ttt[0], ttt[1])
	ccc.append((abs(a - b) + 9) // 10)
	t -= 1
ccc = [str(item) for item in ccc]
print('\n'.join(ccc))


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split(' '))
	k = 0
	if a == b:
		print(k)
		continue
	k += abs(a - b) // 10
	if a + k * 10 == b or a - k * 10 == b:
		print(k)
		continue
	else:
		print(k + 1)


import sys
sys.setrecursionlimit(10 ** 5)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep='\n')

def II():
	return int(sys.stdin.readline())

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

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

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def SI():
	return sys.stdin.readline()[:-1]
for _ in range(II()):
	(a, b) = MI()
	print((abs(a - b) + 9) // 10)


t = int(input())
for i in range(0, t):
	(a, b) = map(int, input().split())
	num = 0
	if a == b:
		pass
	elif a < b:
		diff = b - a
		num += diff // 10
		if diff % 10 != 0:
			num += 1
	else:
		diff = a - b
		num += diff // 10
		if diff % 10 != 0:
			num += 1
	print(num)


def solve():
	l = list(map(int, input().split()))
	a = min(l)
	b = max(l)
	otv = (b - a - (b - a) % 10) // 10
	if (b - a) % 10 != 0:
		otv += 1
	print(otv)
n = int(input())
for _ in range(n):
	solve()


t = int(input())
output = []
for i in range(t):
	(a, b) = input().split(' ')
	a = int(a)
	b = int(b)
	if b > a:
		count = 0
		d = b - a
		count = d // 10
		a = a + 10 * count
		if a == b:
			output.append(count)
		else:
			output.append(count + 1)
	elif b < a:
		count = 0
		d = a - b
		count = d // 10
		a = a - 10 * count
		if a == b:
			output.append(count)
		else:
			output.append(count + 1)
	else:
		output.append(0)
for item in output:
	print(item)


n = int(input())
for _ in range(n):
	y = list(map(int, input().split()))
	a = y[0]
	b = y[1]
	c = abs(a - b)
	r = 0
	while c > 10:
		r += int(c / 10)
		c = c % 10
	if c > 0:
		r = r + 1
	print(r)


t = int(input())
listNEW = []
for i in range(0, t):
	list1 = [int(i) for i in input().split()]
	a = list1[0]
	b = list1[1]
	if a > b:
		c = (a - b) // 10
		d = (a - b) % 10
		if d == 0:
			listNEW.append(c)
		else:
			listNEW.append(c + 1)
	if a == b:
		listNEW.append(0)
	if a < b:
		c = (b - a) // 10
		d = (b - a) % 10
		if d == 0:
			listNEW.append(c)
		else:
			listNEW.append(c + 1)
for i in listNEW:
	print(i)


import math
t = int(input())
output = []
for i in range(t):
	(a, b) = [int(i) for i in input().split()]
	output.append(math.ceil(abs(a - b) / 10))
for i in range(t):
	print(output[i])


j = input()
for i in range(0, int(j)):
	(a, b) = input().split(' ')
	a = int(a)
	b = int(b)
	nb = 0
	dif = abs(a - b)
	nb += dif // 10
	nb += 1 if dif % 10 != 0 else 0
	print(nb)


for _ in range(int(input())):
	(n, ans) = map(int, input().split())
	count = 0
	if n == ans:
		print('0')
	else:
		if n > ans:
			numb = n - ans
		else:
			numb = ans - n
		while numb > 0:
			if numb <= 10:
				count += 1
				numb = 0
			else:
				count += numb // 10
				numb = numb % 10
		print(count)


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	d = abs(a - b)
	k10 = d // 10
	klt = int(d % 10 != 0)
	print(k10 + klt)


import math
import sys
readline = sys.stdin.readline
test_range = readline()
for i in range(int(test_range)):
	(x, y) = readline().split(' ')
	print(math.ceil(abs(int(x) - int(y)) / 10))


t = int(input())
for q in range(t):
	(a, b) = map(int, input().split())
	dif = abs(a - b)
	res = dif / 10
	first = int(res)
	new = str(dif)
	if new[-1] == '0':
		print(first)
	else:
		print(first + 1)


from pathlib import Path
import sys
import functools
import itertools
import re

def solve():
	t = int(input())
	for test in range(0, t):
		(a, b) = map(int, input().split())
		if a == b:
			print(0)
		elif abs(a - b) <= 10:
			print(1)
		else:
			x = abs(a - b) // 10
			y = abs(a - b) % 10
			if y >= 1:
				x += 1
			print(x)

def main():
	if Path('test.inp').exists():
		sys.stdin = open('test.inp', 'r')
	solve()
main()


t = int(input())
for i in range(0, t):
	a = input().split()
	a[0] = int(a[0])
	a[1] = int(a[1])
	b = a[1]
	a = a[0]
	c = abs(a - b)
	moves = 0
	for j in reversed(range(1, 11)):
		if c > 0 and c >= j:
			moves += int(c / j)
			c = c % j
	print(moves)


v = int(input())
for i in range(v):
	a = [int(x) for x in input().split()]
	if a[0] == a[1]:
		print(0)
	elif a[0] > a[1]:
		c = str(a[0] - a[1])
		if len(c) > 1:
			if c[-1] != '0':
				d = c[:-1]
				d = int(d) + 1
			else:
				d = c[:-1]
				d = int(d)
			print(d)
		else:
			print(1)
	elif a[1] > a[0]:
		c = str(a[1] - a[0])
		if len(c) > 1:
			if c[-1] != '0':
				d = c[:-1]
				d = int(d) + 1
			else:
				d = c[:-1]
				d = int(d)
			print(d)
		else:
			print(1)


j = int(input())
for i in range(j):
	c = input().split()
	a = int(c[0])
	b = int(c[1])
	diff = abs(a - b)
	sumi = 0
	if a == b:
		sumi = 0
	else:
		p = 10
		while diff != 0 and p > 0:
			sumi = sumi + diff // p
			diff = diff % p
			p = p - 1
	print(sumi)


import sys

def I():
	return int(sys.stdin.readline().rstrip())

def MI():
	return map(int, sys.stdin.readline().rstrip().split())
t = I()
for i in range(t):
	(a, b) = MI()
	print((abs(a - b) + 9) // 10)


def calc_prblm(a, b):
	n = abs(a - b)
	s = n // 10
	if n % 10 != 0:
		s = s + 1
	return s

def main():
	a = int(input())
	for i in range(a):
		(a, b) = map(int, input().split())
		n = calc_prblm(a, b)
		print(n)

def main_prblm():
	n = 1
	if n >= 1:
		main()
main_prblm()


from math import ceil
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if a == b:
		print('0')
		continue
	else:
		diff = abs(a - b)
		ans = ceil(diff / 10)
		print(ans)


cases = int(input())
for case in range(cases):
	(a, b) = tuple(map(int, input().split()))
	ans = abs(a - b) // 10
	if abs(a - b) % 10 != 0:
		ans += 1
	print(ans)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	else:
		val = 0
		temp = max(a, b) - min(a, b)
		if temp % 10 == 0:
			val = temp // 10
		else:
			val = temp // 10 + 1
		print(val)


from math import ceil
for _ in range(int(input())):
	(a, b) = list(map(int, input().split()))
	(a, b) = (min(a, b), max(a, b))
	z = b - a
	if z == 0:
		print(0)
	else:
		print(ceil(z / 10))


T = int(input())
import math
for t in range(T):
	(a, b) = list(map(int, input().split()))
	k = math.ceil(abs(b - a) / 10)
	print(k)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	n = abs(b - a)
	note = 0
	while n != 0:
		if n // 10 > 0:
			note += n // 10
			n -= n // 10 * 10
		elif n // 9 > 0:
			note += n // 9
			n -= n // 9 * 9
		elif n // 8 > 0:
			note += n // 8
			n -= n // 8 * 8
		elif n // 7 > 0:
			note += n // 7
			n -= n // 7 * 7
		elif n // 6 > 0:
			note += n // 6
			n -= n // 6 * 6
		elif n // 5 > 0:
			note += n // 5
			n -= n // 5 * 5
		elif n // 4 > 0:
			note += n // 4
			n -= n // 4 * 4
		elif n // 3 > 0:
			note += n // 3
			n -= n // 3 * 3
		elif n // 2 > 0:
			note += n // 2
			n -= n // 2 * 2
		elif n // 1 > 0:
			note += n // 1
			n -= n // 1 * 1
	print(note)


from sys import stdin, stdout
for _ in range(int(stdin.readline())):
	(a, b) = list(map(int, stdin.readline().split()))
	diff = abs(a - b)
	m1 = diff // 10
	rem = diff % 10
	print(m1 + (1 if rem != 0 else 0))


def ceil(x, y):
	if x % y == 0:
		return x // y
	else:
		return x // y + 1
n = int(input())
for i in range(n):
	(a, b) = map(int, input().split())
	c = abs(a - b)
	print(ceil(c, 10))


import math
k = int(input())
for _ in range(k):
	[a, b] = [int(x) for x in input().split(' ')]
	print(math.ceil(abs(b - a) / 10))


from sys import stdin, stdout
import math, sys, heapq
from itertools import permutations, combinations
from collections import defaultdict, deque, OrderedDict
from os import path
import random
import bisect as bi

def yes():
	print('YES')

def no():
	print('NO')
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

	def I():
		return int(input())

	def In():
		return map(int, input().split())
else:

	def I():
		return int(stdin.readline())

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

def dict(a):
	d = {}
	for x in a:
		if d.get(x, -1) != -1:
			d[x] += 1
		else:
			d[x] = 1
	return d

def find_gt(a, x):
	i = bi.bisect_left(a, x)
	if i != len(a):
		return i
	else:
		return -1

def main():
	try:
		(a, b) = In()
		dif = abs(a - b)
		ans = 0
		for i in range(10, 0, -1):
			if dif >= i:
				temp = dif // i
				ans += temp
				dif -= temp * i
		print(ans)
	except:
		pass
M = 998244353
P = 1000000007
for _ in range(I()):
	main()


import math
import collections
t = int(input())
for _ in range(0, t):
	(n, m) = map(int, input().split())
	if n != m:
		z = abs(n - m)
		z = z / 10
		z = str(z)
		for i in range(0, len(z)):
			if z[i] == '.':
				break
		if z[i + 1] != '0':
			z = float(z)
			z = int(z) + 1
		else:
			z = float(z)
			z = int(z)
	else:
		z = 0
	print(z)


t = int(input())
res = []
for i in range(t):
	(a, b) = map(int, input().split())
	c = abs(a - b)
	c1 = int(c / 10)
	c2 = c % 10
	if c2 == 0:
		res.append(c1)
	else:
		res.append(c1 + 1)
for i in res:
	print(i)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	k = abs(a - b)
	te = k // 10
	if te * 10 == k:
		print(te)
	else:
		print(te + 1)


import sys
import string
import math
import heapq
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache
from fractions import Fraction

def mi(s):
	return map(int, s.strip().split())

def lmi(s):
	return list(mi(s))

def tmi(s):
	return tuple(mi(s))

def mf(f, s):
	return map(f, s)

def lmf(f, s):
	return list(mf(f, s))

def js(lst):
	return ' '.join((str(d) for d in lst))

def jsns(lst):
	return ''.join((str(d) for d in lst))

def line():
	return sys.stdin.readline().strip()

def linesp():
	return line().split()

def iline():
	return int(line())

def mat(n):
	matr = []
	for _ in range(n):
		matr.append(linesp())
	return matr

def matns(n):
	mat = []
	for _ in range(n):
		mat.append([c for c in line()])
	return mat

def mati(n):
	mat = []
	for _ in range(n):
		mat.append(lmi(line()))
	return mat

def pmat(mat):
	for row in mat:
		print(js(row))

def solve():
	(a, b) = mi(line())
	if b >= a:
		moves = math.ceil((b - a) / 10)
	else:
		moves = math.ceil((a - b) / 10)
	print(moves)

def main():
	t = iline()
	for _ in range(t):
		solve()
main()


import math
for i in range(int(input())):
	(x, y) = map(int, input().split(' '))
	diff = abs(x - y)
	end = math.ceil(diff / 10)
	print(end)


t = int(input())
for i in range(t):
	(a, b) = [int(x) for x in input().split()]
	r = abs(a - b)
	if r % 10 == 0:
		print(r // 10)
	else:
		print(r // 10 + 1)


import sys
input = sys.stdin.readline
t = int(input())
for t1 in range(t):
	(a, b) = list(map(int, input().split(' ')))
	diff = abs(a - b)
	a = 0
	if diff % 10 != 0:
		a = 1
	ans = diff // 10 + a
	print(ans)


n = int(input())
while n != 0:
	(b, a) = map(int, input().split())
	ans = abs(a - b)
	twoans = ans // 10
	if ans % 10 != 0:
		twoans = twoans + 1
	print(twoans)
	n -= 1


def add1(a, b):
	return (abs(a - b) + 10 - 1) / 10
n = int(input())
for i in range(n):
	(a, b) = map(int, input().split())
	print(int(add1(a, b)))


R = lambda : map(int, i.split())
for i in [*open(0)][1:]:
	(a, b) = R()
	print(-abs(a - b) // 10 * -1)


t = int(input())
tasks = []
for i in range(t):
	tasks.append(list(map(int, input().split())))
for i in range(t):
	a = tasks[i][0]
	b = tasks[i][1]
	(a, b) = (max(a, b), min(a, b))
	if a == b:
		print(0)
	else:
		print((a - b - 1) // 10 + 1)


for i in range(int(input())):
	(a, b) = list(map(int, input().split()))
	print((abs(a - b) - 1) // 10 + 1)


from sys import stdin, stdout
from collections import Counter, OrderedDict
import math
cin = stdin.readline
cout = stdout.write
mp = lambda : list(map(int, cin().split()))

def chars():
	s = cin()
	return list(s[:len(s) - 1])

def pl(a):
	for val in a:
		cout(str(val))
	cout('\n')
(t,) = mp()
for _ in range(t):
	(a, b) = mp()
	x = abs(a - b)
	pl([math.ceil(x / 10)])


import sys, time
import math
start_time = time.time()

def solved():
	(a, b) = in_int_map()
	diff = abs(a - b)
	print(math.ceil(diff / 10))
ONLINE_JUDGE = True

def main():
	global tt
	if not ONLINE_JUDGE:
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	t = in_int()
	for tt in range(1, t + 1):
		solved()
	if not ONLINE_JUDGE:
		print('Time Elapsed :', time.time() - start_time, 'seconds')
		sys.stdout.close()

def in_int():
	return int(input().strip())

def in_float():
	return float(input().strip())

def in_int_list():
	return list(map(int, input().split()))

def in_int_map():
	return map(int, input().split())

def in_float_list():
	return list(map(float, input().split()))

def in_float_map():
	return map(float, input().split())

def in_str():
	return input().strip()

def in_str_list():
	return input().split()
if ONLINE_JUDGE:
	import io, os
	input = sys.stdin.readline
main()


def get_min_moves(a, b):
	diff = abs(b - a)
	if diff == 0:
		return 0
	return -(-diff // 10)
t = int(input())
for i in range(t):
	(a, b) = list(map(int, input().split()))
	print(get_min_moves(a, b))


def ans(a, b):
	return abs(a - b) // 10 + (1 if abs(a - b) % 10 != 0 else 0)
t = int(input())
while t > 0:
	(a, b) = list(map(int, input().split(' ')))
	out = ans(a, b)
	print(out)
	t -= 1


def problem(a, b):
	ans = 0
	if a == b:
		return ans
	max_ = max(a, b)
	min_ = min(a, b)
	temp = max_ - min_
	ans = temp // 10
	if temp % 10 != 0:
		ans += 1
	return ans
testcases = int(input())
for i in range(testcases):
	(a, b) = list(map(int, input().split()))
	res = problem(a, b)
	print(res)


n = int(input())
for i in range(0, n):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
		continue
	if a > b:
		a = a - b
	else:
		a = b - a
	c = a // 10
	if a % 10 == 0:
		print(c)
	else:
		print(c + 1)


import math
t = int(input())
while t > 0:
	t = t - 1
	(n, m) = map(int, input().split())
	ab = abs(n - m)
	if ab % 10 == 0:
		print(ab // 10)
	else:
		print(ab // 10 + 1)


t = int(input())
for i in range(t):
	k = 0
	d = 0
	(a, b) = map(int, input().split())
	if a == b:
		print('0')
		continue
	if a > b:
		d = (a - b + 9) / 10
		print(int(d))
	if a < b:
		d = (b - a + 9) / 10
		print(int(d))


tc = int(input())
while tc > 0:
	(a, b) = map(int, input().split())
	res = abs(b - a)
	div = res // 10
	if res % 10 != 0:
		div += 1
	print(div)
	tc -= 1


n = int(input())
anss = []
per = 0
count = 0
for i in range(n):
	ab = input().split()
	a = int(ab[0])
	b = int(ab[1])
	if a > b:
		per = a - b
	else:
		per = b - a
	count += per // 10
	if per % 10 != 0:
		count += 1
	anss.append(count)
	count = 0
for i in anss:
	print(i)


import sys
t = int(sys.stdin.readline())
for test in range(t):
	(a, b) = map(int, sys.stdin.readline().split())
	d = abs(a - b) + 9
	ans = d // 10
	print(ans)


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	k = abs(a - b)
	r = k // 10
	r1 = k % 10
	if r1 == 0:
		print(r)
	else:
		print(r + 1)


from math import ceil
for _ in range(int(input())):
	(awal, tujuan) = map(int, input().split())
	if tujuan == awal:
		print(0)
	elif tujuan > awal:
		print(ceil((tujuan - awal) / 10))
	elif tujuan < awal:
		print(ceil((awal - tujuan) / 10))


import math
t = int(input())
out = []
for i in range(t):
	ab = input().split(' ')
	a = int(ab[0])
	b = int(ab[1])
	ans = math.ceil(abs(a - b) / 10)
	out.append(ans)
for i in out:
	print(i)


for i in range(int(input())):
	(a, b) = sorted(map(int, input().split()))
	dif = b - a
	(difm, difd) = (dif % 20, dif // 20)
	print(dif // 20 * 2 + bool(difm) + bool(difm % 20 > 10))


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if a < b:
		temp = b
		b = a
		a = temp
	if a == b:
		print('0')
	else:
		k = a - b
		ans = k // 10
		p = k % 10
		if p != 0:
			ans += 1
		print(ans)


q = int(input())
a = []
b = []
res = []
for i in range(q):
	(A, B) = (int(j) for j in input().split())
	a.append(A)
	b.append(B)
for i in range(q):
	x = a[i]
	y = b[i]
	result = 0
	if y == x:
		result = 0
	elif x < y:
		z = y - x
		result = z // 10
		if z % 10 != 0:
			result += 1
	elif y < x:
		z = x - y
		result = z // 10
		if z % 10 != 0:
			result += 1
	res.append(result)
for pororo in range(q):
	print(res[pororo])


t = int(input())
for p in range(t):
	(a, b) = map(int, input().split())
	c = abs(a - b)
	k = c // 10
	if c % 10 != 0:
		k += 1
	print(k)


import math
t = int(input())
for tc in range(t):
	(a, b) = map(int, input().split())
	x = abs(a - b) % 10
	if x == 0:
		if a != b:
			print(int(abs(a - b) / 10))
		else:
			print(0)
	else:
		print(int(math.ceil(abs(a - b) / 10)))


for _ in range(int(input())):
	(a, b) = sorted(map(int, input().split()))
	k = b - a
	print(k // 10 + (k % 10 > 0))


t = int(input())
while t:
	(a, b) = map(int, input().split())
	x = abs(a - b)
	y = x // 10
	z = x - y * 10
	if z > 0:
		print(y + 1)
	else:
		print(y)
	t -= 1


for i in range(int(input())):
	(a, b) = map(int, input().split(' '))
	m = max([a, b])
	n = min([a, b])
	ans = 0
	m -= n
	while m > 0:
		if m >= 10:
			ans += m // 10
			m = m % 10
		else:
			m -= m
			ans += 1
	print(ans)


for i in range(int(input())):
	(a, b) = [int(num) for num in input().split()]
	if a == b:
		print(0)
		continue
	d = abs(b - a)
	if d % 10 == 0:
		print(d // 10)
	else:
		print(d // 10 + 1)


n = int(input())
count = 0
for i in range(n):
	z = input().split(' ')
	a = int(z[0])
	b = int(z[1])
	if abs(b - a) % 10 == 0:
		count = abs(b - a) // 10
		print(count)
	else:
		count = abs(b - a) // 10 + 1
		print(count)


myList = []
for _ in range(int(input())):
	(a, b) = list(map(int, input().split()))
	if a == b:
		myList.append(0)
	elif abs(a - b) <= 10:
		myList.append(1)
	else:
		q = abs(a - b) // 10
		if (a - b) % 10 != 0:
			myList.append(q + 1)
		else:
			myList.append(q)
for elem in myList:
	print(elem)


import time, math as mt, bisect as bs, sys
from sys import stdin, stdout
from collections import deque
from fractions import Fraction
from collections import Counter
from collections import OrderedDict
pi = 3.141592653589793

def II():
	return int(stdin.readline())

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

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

def P(x):
	return stdout.write(str(x) + '\n')

def PI(x, y):
	return stdout.write(str(x) + ' ' + str(y) + '\n')

def lcm(a, b):
	return a * b // gcd(a, b)

def gcd(a, b):
	if a == 0:
		return b
	elif b == 0:
		return a
	if a > b:
		return gcd(a % b, b)
	else:
		return gcd(a, b % a)

def bfs(adj, v):
	visited = [False] * (v + 1)
	q = deque()
	while q:
		pass

def sieve():
	li = [True] * (2 * 10 ** 5 + 5)
	(li[0], li[1]) = (False, False)
	for i in range(2, len(li), 1):
		if li[i] == True:
			for j in range(i * i, len(li), i):
				li[j] = False
	prime = []
	for i in range(2 * 10 ** 5 + 5):
		if li[i] == True:
			prime.append(i)
	return prime

def setBit(n):
	count = 0
	while n != 0:
		n = n & n - 1
		count += 1
	return count
mx = 10 ** 7
spf = [mx] * (mx + 1)

def SPF():
	spf[1] = 1
	for i in range(2, mx + 1):
		if spf[i] == mx:
			spf[i] = i
			for j in range(i * i, mx + 1, i):
				if i < spf[j]:
					spf[j] = i
	return

def readTree(n, e):
	adj = [set() for i in range(n + 1)]
	for i in range(e):
		(u1, u2) = IP()
		adj[u1].add(u2)
	return adj
mod = 10 ** 9 + 7

def solve():
	(a, b) = IP()
	diff = max(a, b) - min(a, b)
	ans = diff // 10
	if diff % 10:
		ans += 1
	P(ans)
	return
t = II()
for i in range(t):
	solve()


n = int(input())
resultados = []
for i in range(n):
	ab = input().split()
	a = int(ab[0])
	b = int(ab[1])
	if b - a > 0:
		if (b - a) % 10 != 0:
			resultados.append((b - a) // 10 + 1)
		else:
			resultados.append((b - a) // 10)
	if b - a < 0:
		if (b - a) % 10 != 0:
			resultados.append((a - b) // 10 + 1)
		else:
			resultados.append((a - b) // 10)
	if b - a == 0:
		resultados.append(0)
for i in resultados:
	print(i)


l = []
for i in range(int(input())):
	(a, b) = map(int, input().split())
	if abs(a - b) % 10 != 0:
		k = abs(a - b) // 10 + 1
	else:
		k = abs(a - b) // 10
	l.append(k)
for i in l:
	print(i)


t = int(input())
for tests in range(t):
	(a, b) = map(int, input().split())
	print((abs(b - a) + 9) // 10)


n = int(input())
for t in range(n):
	s = input()
	(a, b) = s.split()
	(a, b) = (int(a), int(b))
	d = a - b
	if d < 0:
		d *= -1
	c = 0
	if d == 0:
		print(0)
	else:
		for i in range(10, 0, -1):
			c += d // i
			d = d % i
			if d == 0:
				break
		print(c)


import math

def calc(a, b):
	return math.ceil(abs(b - a) / 10)
n = int(input())
for i in range(n):
	line = input().split()
	a = int(line[0])
	b = int(line[1])
	print(calc(a, b))


def main():
	t = int(input())
	for _ in range(t):
		(a, b) = [int(x) for x in input().split()]
		if a == b:
			print(0)
			continue
		diff = abs(a - b)
		steps = diff // 10
		if diff % 10 != 0:
			steps += 1
		print(steps)
main()


t = int(input())

def Mod(n, m):
	if abs(n - m) < 10:
		if n == m:
			return 0
		else:
			return 1
	elif abs(n - m) % 10 == 0:
		return abs(n - m) // 10
	else:
		return 1 + abs(n - m) // 10
for i in range(t):
	A = list(map(int, input().split()))
	a = A[0]
	b = A[1]
	print(Mod(a, b))


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if b < a:
		(a, b) = (b, a)
	print((b - a + 9) // 10)


import math
T = int(input())
for t in range(T):
	(A, B) = input().split()
	A = int(A)
	B = int(B)
	print(math.ceil(abs(B - A) / 10))


n = int(input())
for i in range(n):
	(a, b) = map(int, input().split())
	count = 0
	diff = abs(a - b)
	if diff != 0:
		count += diff // 10
		if diff % 10 != 0:
			count += 1
	print(count)


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

def solve(a, b):
	if a > b:
		(a, b) = (b, a)
	if b == a:
		return 0
	return (b - a) // 10 + (1 if (b - a) % 10 else 0)
lines = inp()
for i in range(lines):
	v = inlt()
	print(solve(*v))


import sys
import math
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
mod = 1000000007

def nospace(l):
	ans = ''.join((str(i) for i in l))
	return ans
t = int(input())
for tt in range(t):
	(a, b) = map(int, sys.stdin.readline().split(' '))
	d = abs(b - a)
	v = d // 10
	if d % 10 == 0:
		print(v)
	else:
		print(v + 1)
if fileoperation:
	sys.stdout = orig_stdout
	sys.stdin = orig_stdin
	inputfile.close()
	outputfile.close()


t = int(input())
while t > 0:
	(a, b) = [int(i) for i in input().split()]
	ans = abs(b - a) // 10 + (abs(b - a) % 10 != 0)
	print(ans)
	t -= 1


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	(a1, b1) = (a, b)
	ans = 0
	if a < b:
		dif = b - a
		ans += dif // 10
		if dif % 10 != 0:
			ans += 1
	elif b < a:
		dif = a - b
		ans += dif // 10
		if dif % 10 != 0:
			ans += 1
	print(ans)


def solve():
	(a, b) = map(int, input().split())
	res = abs(a - b)
	if res % 10 == 0:
		return res // 10
	else:
		return res // 10 + 1
for __ in range(int(input())):
	print(solve())


def check(a, b):
	step = (b - b % 10 - (a - a % 10)) // 10
	if a % 10 < b % 10:
		step += 1
	return step
I = input
t = int(I())
for i in range(t):
	(a, b) = map(int, I().split())
	if a == b:
		print(0)
	elif a > b:
		print(check(b, a))
	else:
		print(check(a, b))


import math

def addorsub(num, test):
	if num > test:
		return False
	else:
		return True

def step(x, y):
	difference = abs((x - y) / 10)
	print(math.ceil(difference))
iter = int(input())
ip = []
for i in range(iter):
	inp = input()
	ip.append(inp)
for ele in ip:
	(n1, n2) = ele.split(' ')
	n1 = int(n1)
	n2 = int(n2)
	if n1 == n2:
		print(0)
	elif addorsub(n1, n2):
		step(n1, n2)
	elif abs(n1 - n2 <= 10):
		print(1)
	else:
		step(n2, n1)


from bisect import bisect_right

def no_op(a: int, b: int, k_val: list) -> int:
	count = 0
	diff = abs(a - b)
	while diff:
		index = bisect_right(k_val, diff)
		if index != 0:
			count += diff // k_val[index - 1]
			diff %= k_val[index - 1]
	return count
T = int(input())
for _ in range(T):
	(a, b) = map(int, input().split())
	k_val = list(range(1, 11))
	print(no_op(a, b, k_val))


for i in range(int(input())):
	(n, x) = map(int, input().split())
	print((abs(n - x) + 9) // 10)


t = int(input())
k = 10
for i in range(t):
	c = 1
	(a, b) = map(int, input().split())
	if a == b:
		c = 0
		print(c)
	else:
		d = abs(a - b)
		k1 = d // k
		r = d % k
		if r == 0:
			c = 0
			c += k1
			print(c)
		else:
			c += k1
			print(c)


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	ans = 0
	d = 10
	x = abs(a - b)
	while x > 0 and d > 0:
		p = x // d
		ans += p
		x = x % d
		d -= 1
	print(ans)


import os
from sys import stdin, stdout

def solve(tc):
	(a, b) = map(int, stdin.readline().split())
	diff = abs(a - b)
	ans = diff // 10
	if diff % 10:
		ans += 1
	print(ans)
tcs = 1
tcs = int(stdin.readline().strip())
tc = 1
while tc <= tcs:
	solve(tc)
	tc += 1


import sys
input = sys.stdin.readline
(inp, ip) = (lambda : int(input()), lambda : [int(w) for w in input().split()])
for _ in range(inp()):
	(a, b) = ip()
	d = abs(a - b)
	print((d - 1) // 10 + 1)


no = int(input())
for i in range(no):
	(a, b) = map(int, input().split())
	c = abs(a - b)
	d = c % 10
	c = c - d
	c = c // 10
	if d != 0:
		c += 1
	print(c)


import math
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	p = max(a, b)
	q = min(a, b)
	i = p - q
	print(math.ceil(i / 10))


import math
t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	n = abs(a - b)
	count = 0
	for i in range(10, 0, -1):
		temp = n // i
		count += temp
		n -= temp * i
		if n == 0:
			break
	print(count)


num = int(input())
for val in range(num):
	num_list = [int(val) for val in input().split()]
	store = abs(num_list[0] - num_list[1])
	if store % 10 == 0:
		print(store // 10)
	else:
		print(store // 10 + 1)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	ans = 0
	while a != b:
		if a < b:
			for j in range(10, 0, -1):
				x = b - a
				ans += x // j
				a += x // j * j
		else:
			for j in range(10, 0, -1):
				x = a - b
				ans += x // j
				b += x // j * j
	print(ans)


for case in range(int(input())):
	(a, b) = [int(a) for a in input().split()]
	diff = abs(a - b)
	moves = diff // 10
	if diff % 10 == 0:
		print(moves)
	else:
		print(moves + 1)


t = int(input())
for i in range(t):
	a = input()
	l = list(map(int, a.split()))
	c = max(l) - min(l)
	n = c // 10
	m = c % 10
	if not m == 0:
		m = 1
	print(m + n)


T = int(input())
for testcase in range(T):
	[a, b] = [int(i) for i in input().split()]
	result = (abs(b - a) - 1) // 10 + 1
	print(result)


import sys, math, bisect
from collections import Counter, defaultdict as dd

def data():
	return sys.stdin.readline().strip()

def out(var):
	sys.stdout.write(str(var))

def l():
	return list(sp())

def strl():
	return list(strsp())

def sp():
	return map(int, data().split())

def strsp():
	return map(str, data().split())
for _ in range(int(data())):
	(a, b) = sp()
	c = abs(a - b)
	if c == 0:
		print(0)
	elif c < 10:
		print(1)
	else:
		d = math.ceil(c / 10)
		print(d)


def operation(pairInt):
	module = abs(pairInt[0] - pairInt[1])
	if module == 0:
		return 0
	elif module % 10 == 0:
		return module // 10
	else:
		return module // 10 + 1
results = []
t = int(input())
for i in range(0, t):
	pairInt = list(map(int, input().split()))
	resultOfOper = operation(pairInt)
	results.append(resultOfOper)
for k in results:
	print(k)


import math
T = int(input())
while T != 0:
	st = list(input().split())
	a = int(st[0])
	b = int(st[1])
	x = math.ceil(abs(a - b) / 10)
	print(x)
	T = T - 1


def ab(a):
	if a >= 0:
		return a
	else:
		return -a
t = int(input())
for i in range(t):
	s = input().split()
	a = int(s[0])
	b = int(s[1])
	c = ab(a - b)
	if c % 10 == 0:
		print(c // 10)
	else:
		print(c // 10 + 1)


import sys
inp = sys.stdin.readline
out = sys.stdin.write

def minp(x):
	return map(int, x.split())

def linp(x):
	return list(minp(x))

def main():
	for _ in range(int(inp())):
		(a, b) = minp(inp())
		if abs(a - b) % 10 == 0:
			print(abs(a - b) // 10)
		else:
			print(abs(a - b) // 10 + 1)
main()


def readstr():
	return list(map(int, input().split()))
cases = readstr()[0]

def transform(a, b):
	steps = abs(a - b) // 10
	rem = abs(a - b) - steps * 10
	if rem > 0:
		steps += 1
	return steps
output = []
for _ in range(int(cases)):
	(a, b) = readstr()
	output.append(transform(a, b))
print('\n'.join(map(str, output)))


import math
from decimal import *
import random
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if a >= b:
		val = a - b
		ans = val // 10
		val -= ans * 10
		if val > 0:
			ans += 1
		print(ans)
	else:
		val = b - a
		ans = val // 10
		val -= 10 * ans
		if val > 0:
			ans += 1
		print(ans)


import sys
import math
import heapq
import collections

def inputnum():
	return int(input())

def inputnums():
	return map(int, input().split())

def inputlist():
	return list(map(int, input().split()))

def inputstring():
	return [x for x in input()]

def inputstringnum():
	return [ord(x) - ord('a') for x in input()]

def inputmatrixchar(rows):
	arr2d = [[j for j in input().strip()] for i in range(rows)]
	return arr2d

def inputmatrixint(rows):
	arr2d = []
	for _ in range(rows):
		arr2d.append([int(i) for i in input().split()])
	return arr2d
t = int(input())
for q in range(t):
	(a, b) = inputnums()
	c = abs(a - b)
	ans = 0
	if c % 10 != 0:
		ans += 1
	ans += c // 10
	print(ans)


import math
d = list()
n = int(input())
for i in range(n):
	a = [int(x) for x in input().split()]
	a.sort()
	out = math.ceil((a[1] - a[0]) / 10)
	d.append(out)
for i in d:
	print(i)


for _ in range(int(input())):
	(a, b) = list(map(int, input().split()))
	if a == b:
		print(0)
		continue
	if abs(a - b) <= 10:
		print(1)
		continue
	if abs(a - b) % 10 == 0:
		print(abs(a - b) // 10)
	else:
		print(abs(a - b) // 10 + 1)


import sys
infile = sys.stdin
next(infile)
for line in infile:
	l = list(map(int, line.split()))
	a = l[0]
	b = l[1]
	d = abs(a - b)
	if d % 10 == 0:
		print(d // 10)
	else:
		print(d // 10 + 1)


import sys
t = int(sys.stdin.readline().split()[0])
tests = [[0 for x in range(2)] for y in range(t)]
row = 0
for line in sys.stdin:
	column = 0
	for word in line.split():
		tests[row][column] = int(word)
		column += 1
	row += 1
for test in tests:
	a = test[0]
	b = test[1]
	if a == b:
		print(0)
	elif a < b:
		if (b - a) % 10 == 0:
			print(int((b - a) / 10))
		else:
			print((b - a) // 10 + 1)
	elif a > b:
		if (a - b) % 10 == 0:
			print(int((a - b) / 10))
		else:
			print((a - b) // 10 + 1)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	else:
		i = 0
		A = abs(a - b)
		if A % 10 > 0:
			i = 1
		print(i + A // 10)


from math import ceil
query = int(input())
for _ in range(query):
	(n, m) = map(int, input().split())
	d = abs(n - m)
	print(ceil(d / 10))


import math
k = int(input())
for x in range(k):
	(a, b) = map(int, input().split(' '))
	result = 0
	print(math.ceil((max(a, b) - min(a, b)) / 10))


t = int(input())
lst = []
for _ in range(t):
	(a, b) = map(int, input().split())
	count = 0
	if abs(a - b) in range(1, 11):
		count += 1
	elif abs(a - b) == 0:
		count = 0
	else:
		x = abs(a - b) // 10
		if abs(a - b) % 10 == 0:
			count += x
		else:
			count += x + 1
	lst.append(count)
for i in range(t):
	print(lst[i])


n = int(input())
while n > 0:
	(a, b) = [int(x) for x in input().split()]
	count = 0
	if a > b:
		if (a - b) % 10 == 0:
			count = (a - b) // 10
		else:
			count = (a - b) // 10 + 1
	elif b > a:
		if (b - a) % 10 == 0:
			count = (b - a) // 10
		else:
			count = (b - a) // 10 + 1
	else:
		count = 0
	print(count)
	n -= 1


from sys import stdin
input = lambda : stdin.readline().strip()
import math
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	x = abs(b - a)
	if x != 0:
		print(math.ceil(x / 10))
	else:
		print(0)


n = int(input())
for i in range(n):
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	if a > b:
		x = a
		a = b
		b = x
	j = (b - a) // 10
	if a + 10 * j == b:
		print(j)
	else:
		print(j + 1)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	cnt = 0
	if a >= b:
		cnt += (a - b) // 10
		a -= (a - b) // 10 * 10
	else:
		cnt += (b - a) // 10
		a += (b - a) // 10 * 10
	if a == b:
		print(cnt)
	else:
		print(cnt + 1)


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	s = 0
	k = 10
	l = abs(a - b)
	while l > 0:
		while l // k == 0:
			k -= 1
		s += l // k
		l = l % k
	print(s)


import math
testcasesNumber = int(input())
for number in range(testcasesNumber):
	(x, y) = [int(x) for x in input().split()]
	z = 0
	if x == y:
		print(0)
	else:
		n = abs(x - y)
		quotient = math.floor(n / 10)
		rem = n % 10
		if rem == 0:
			z = int(quotient)
		else:
			z = int(quotient) + 1
		print(z)


import sys

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
t = int(input())
for _ in range(t):
	(a, b) = list(map(int, input().split()))
	if b == a:
		print(0)
		continue
	elif (b - a) % 10 == 0:
		print(abs((b - a) // 10))
		continue
	if b < a:
		(a, b) = (b, a)
	print((b - a) // 10 + 1)


def change(a, b):
	if a <= b:
		diff = b - a
		if diff == 0:
			return 0
		rem = 0
		step = 0
		if diff > 10:
			step += diff // 10
			diff = diff % 10
		if diff != 0:
			return step + 1
		else:
			return step
	else:
		return change(b, a)
t = int(input())
(x, y) = ([0] * t, [0] * t)
for i in range(t):
	(x[i], y[i]) = input().split()
for i in range(t):
	print(change(int(x[i]), int(y[i])))


for ___ in range(int(input())):
	(a, b) = list(map(int, input().split()))
	tmp = abs(a - b)
	if tmp % 10 != 0:
		tmp = tmp // 10 + 1
	else:
		tmp = tmp // 10
	print(tmp)


n = int(input())
for j in range(n):
	count = 0
	(a, b) = map(int, input().split())
	if a == b:
		count = 0
	else:
		c = abs(a - b)
		if c % 10 < 10 and c % 10 > 0:
			count += 1
			count += int(c / 10)
		else:
			count += int(c / 10)
	print(count)


import os
import sys
import math
from io import BytesIO, IOBase

def main():
	t = [10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
	for _ in range(int(input())):
		(a, b) = [int(x) for x in sys.stdin.readline().split()]
		d = abs(a - b)
		i = 0
		count = 0
		while d > 0:
			if d // t[i] != 0:
				count += d // t[i]
				d -= d // t[i] * t[i]
			i += 1
		print(count)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
main()


t = int(input())
while t:
	(a, b) = map(int, input().split())
	ans = 0
	if a == b:
		ans = 0
	elif a > b:
		a -= b
		rem = a % 10
		div = a // 10
		ans += div
		if rem != 0:
			ans += 1
	elif a < b:
		a = b - a
		rem = a % 10
		div = a // 10
		ans += div
		if rem != 0:
			ans += 1
	print(ans)
	t -= 1


from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush, heappop, heapify
import math
from collections import *
from functools import reduce, cmp_to_key
import sys
input = sys.stdin.readline
from itertools import accumulate
from functools import lru_cache
M = mod = 10000

def factors(n):
	return sorted(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def inv_mod(n):
	return pow(n, mod - 2, mod)

def li():
	return [int(i) for i in input().rstrip('\n').split()]

def st():
	return input().rstrip('\n')

def val():
	return int(input().rstrip('\n'))

def li2():
	return [i for i in input().rstrip('\n')]

def li3():
	return [int(i) for i in input().rstrip('\n')]
for _ in range(val()):
	(a, b) = sorted(li())
	print(math.ceil((b - a) / 10))


for _ in range(int(input().strip())):
	(a, b) = tuple(map(int, input().strip().split()))
	ans = abs(a - b) / 10
	if int(ans) != ans:
		ans += 1
	print(int(ans))


tc = int(input())

def minMoves(a, b):
	d = abs(a - b)
	return d // 10 + (1 if d % 10 > 0 else 0)
for i in range(tc):
	s = input()
	(a, b) = s.split()
	print(minMoves(int(a), int(b)))


for _ in range(int(input())):
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	ans = abs(a // 10 - b // 10)
	if a > b and a % 10 > b % 10:
		ans += 1
	elif a < b and a % 10 < b % 10:
		ans += 1
	print(ans)


for i in range(int(input())):
	(a, b) = map(int, input().split())
	if b <= a:
		print(-((b - a) // 10))
	else:
		print(--abs((a - b) // 10))


x = int(input())
for i in range(x):
	(a, b) = [int(i) for i in input().split()]
	valor = abs(a - b)
	divisoes = valor // 10
	if valor % 10 != 0:
		divisoes += 1
	print(divisoes)


t = int(input())
while t > 0:
	lst1 = list(map(int, input().split()))
	maxer = int(max(lst1[0], lst1[1]) - min(lst1[0], lst1[1]))
	if maxer % 10 == 0:
		ans = maxer // 10
	else:
		ans = maxer // 10 + 1
	print(ans)
	t -= 1


t = int(input())
while t:
	(a, b) = map(int, input().split())
	if b != a:
		c = abs(b - a)
		c = c / 10
		c = str(c)
		for i in range(0, len(c)):
			if c[i] == '.':
				break
		if c[i + 1] != '0':
			c = float(c)
			c = int(c) + 1
		else:
			c = float(c)
			c = int(c)
	else:
		c = 0
	print(c)
	t -= 1


t_count = int(input().strip())
while t_count > 0:
	(a, b) = list(map(int, input().strip().split(' ')))
	diff = abs(a - b)
	moves = diff // 10
	if diff % 10:
		moves += 1
	print(moves)
	t_count -= 1


t = int(input())
for i in range(t):
	q = [int(el) for el in input().split()]
	a = q[0]
	b = q[1]
	k1 = min(a, b)
	k2 = max(a, b)
	d = k2 - k1
	if d % 10 == 0:
		print(d // 10)
	else:
		print(d // 10 + 1)


a = int(input())
for i in range(a):
	(b, c) = [int(x) for x in input().split()]
	if b == c:
		d = 0
	if b > c:
		d = b - c
	if b < c:
		d = c - b
	if d % 10 == 0:
		print(d // 10)
	if d % 10 != 0:
		print(d // 10 + 1)


for i in range(int(input())):
	(a, b) = map(int, input().split())
	p = abs(b - a)
	print(p // 10 + (p % 10 != 0))


from math import ceil

def main():
	n = int(input())
	for i in range(n):
		(x, y) = map(int, input().split(' '))
		res = abs(x - y) / 10
		print(ceil(res))
main()


t = int(input())
while t:
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	elif a > b:
		if a - b <= 10:
			print(1)
		else:
			ans = a - b
			c = ans // 10
			if ans % 10 == 0:
				print(c)
			else:
				print(c + 1)
	elif b - a <= 10:
		print(1)
	else:
		ans = b - a
		c = ans // 10
		if ans % 10 == 0:
			print(c)
		else:
			print(c + 1)
	t = t - 1


import math

def cal(a, b):
	return math.ceil(abs(a - b) / 10)
t = int(input())
while t:
	(a, b) = map(int, input().split())
	print(cal(a, b))
	t -= 1


t = int(input())
for r in range(t):
	(a, b) = list(map(int, input().split()))
	c = abs(a - b) / 10
	if c == int(c):
		print(int(c))
	else:
		print(int(c) + 1)


import sys

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 19
MOD = 10 ** 9 + 7
for _ in range(INT()):
	(a, b) = MAP()
	dist = abs(a - b)
	ans = ceil(dist, 10)
	print(ans)


t = int(input())
for i in range(t):
	(a, b) = list(map(int, input().split()))
	ans = 0
	difference = abs(a - b)
	divisor = difference // 10
	remind = difference % 10
	if remind != 0:
		ans += 1
	ans += divisor
	print(ans)


def solve():
	(a, b) = list(map(int, input().split()))
	if a < b:
		(a, b) = (b, a)
	print((a - b + 9) // 10)
ct = int(input())
while ct > 0:
	solve()
	ct -= 1


for n in range(int(input())):
	(a, b) = map(int, input().split())
	print((abs(a - b) + 9) // 10)


def solve(a, b):
	if a == b:
		print(0)
		return
	x = abs(a - b)
	req_moves = x // 10
	if x % 10 == 0:
		print(req_moves)
	else:
		print(req_moves + 1)
t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	solve(a, b)


import sys
import math, bisect
sys.setrecursionlimit(10 ** 5)
from collections import defaultdict
from itertools import groupby, accumulate
from heapq import heapify, heappop, heappush
from collections import deque, Counter, OrderedDict

def I():
	return int(sys.stdin.readline())

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

def Neo():
	return list(map(int, sys.stdin.readline().split()))
for _ in range(I()):
	(a, b) = neo()
	(b, a) = (max(a, b), min(a, b))
	print(math.ceil((b - a) / 10))


def calcu(gr, lo):
	cal = (gr - lo) % 10
	if cal > 0:
		return int((gr - lo) / 10 + 1)
	else:
		return int((gr - lo) / 10)
n = int(input())
op = list(range(n))
k = list(range(2))
for i in range(n):
	str = input()
	k = str.split()
	z = 0
	for l in k:
		k[z] = int(l)
		z += 1
	a = k[0]
	b = k[1]
	da = a
	cntr = 0
	process = 0
	if da == b:
		cntr = 0
	elif da > b:
		cntr = calcu(da, b)
	elif da < b:
		cntr = calcu(b, da)
	op[i] = cntr
	k.clear()
for i in op:
	print(i)


import math
n = int(input())
for _ in range(n):
	(a, b) = map(int, input().split(' '))
	if a == b:
		print('0')
	else:
		t = abs(a - b)
		v = math.floor(t / 10)
		z = max(a, b)
		if z - v * 10 == min(a, b):
			print(v)
		else:
			print(v + 1)


def solve(a, b):
	diff = abs(a - b)
	if diff % 10 == 0:
		print(diff // 10)
	else:
		print(diff // 10 + 1)
t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	solve(a, b)


import math
t = int(input())
while t > 0:
	(a, b) = [int(i) for i in input().split()]
	if a > b:
		ans = math.ceil((a - b) / 10)
	else:
		ans = math.ceil((b - a) / 10)
	print(ans)
	t -= 1


from math import ceil
for _ in range(int(input())):
	(a, b) = [int(x) for x in input().split()]
	diff = abs(a - b)
	if a == b:
		print(0)
	else:
		print(ceil(diff / 10))


from math import ceil
t = int(input())
for i in range(0, t):
	(a, b) = map(int, input().split())
	x = abs(a - b)
	ans = ceil(x / 10)
	print(ans)


import sys

def solve(A, n):
	if a == b:
		return 0
	elif abs(a - b) % 10 == 0:
		return abs(a - b) // 10
	else:
		return abs(a - b) // 10 + 1
t = int(input())
while t:
	t -= 1
	(a, b) = [i for i in map(int, input().strip().split())]
	print(solve(a, b))


import sys
input = sys.stdin.readline
from bisect import bisect_left
from bisect import bisect_right
from math import ceil, factorial

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def nCr(n, k):
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def factoriazation(x):
	ret = {}
	while x != 1:
		ret[spf[x]] = ret.get(spf[x], 0) + 1
		x = x // spf[x]
	return ret

def int_array():
	return list(map(int, input().strip().split()))

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
for _ in range(int(input())):
	(a, b) = int_array()
	x = abs(a - b)
	print(int(ceil(x / 10)))


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	r = abs(b - a) // 10
	if abs(b - a) // 10 == abs(b - a) / 10:
		ans = r
	else:
		ans = r + 1
	print(ans)


n = int(input())
res = ''
for x in range(n):
	(a, b) = map(int, input().split())
	k = max(a, b) - min(a, b)
	c = 0
	if k >= 10:
		c += k // 10
		k %= 10
	if k <= 0:
		res += str(c) + '\n'
	else:
		c += 1
		res += str(c) + '\n'
res = res.strip('\n')
print(res)


t = int(input())
out = []

def find(a, b):
	m = a - b
	n = m % 10
	if n != 0:
		out.append(m // 10 + 1)
	else:
		out.append(m // 10)
for i in range(t):
	(a, b) = map(int, input().split())
	if a > b:
		find(a, b)
	else:
		find(b, a)
for i in out:
	print(i)


import math
no = int(input())
lst = list()
for i in range(no):
	x = input()
	lst.append(x)

def minmove(num1, num2):
	diff = abs(num1 - num2) / 10
	print(math.ceil(diff))
for j in lst:
	(num1, num2) = j.split(' ')
	num1 = int(num1)
	num2 = int(num2)
	if num1 == num2:
		print(0)
	else:
		minmove(num1, num2)


T = int(input())
for i in range(T):
	(a, b) = [int(s) for s in input().split()]
	count = 0
	if a == b:
		print(0)
	elif abs(a - b) < 10:
		print(1)
	elif abs(a - b) % 10 == 0:
		print(abs(a - b) // 10)
	else:
		print(abs(a - b) // 10 + 1)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if a == b:
		ans = 0
	elif a > b:
		c = a - b
		d = c // 10
		m = c % 10
		if m == 0:
			ans = d
		else:
			ans = 1 + d
	elif a < b:
		c = b - a
		d = c // 10
		m = c % 10
		if m == 0:
			ans = d
		else:
			ans = 1 + d
	print(ans)


for x in range(int(input())):
	(a, b) = map(int, input().split())
	moves = 0
	if b == a:
		pass
	elif abs(a - b) % 10 == 0:
		moves = abs(a - b) // 10
	else:
		moves = abs(a - b) // 10 + 1
	print(moves)


n = int(input())
l = []
for i in range(n):
	(a, b) = map(int, input().split())
	k = abs(a - b)
	if k == 0:
		ans = 0
	elif k > 10:
		if k % 10 == 0:
			ans = k // 10
		else:
			k = k // 10
			ans = 1 + k
	else:
		ans = 1
	l.append(ans)
for j in l:
	print(j)


def f(a, b):
	return (abs(a - b) + 10 - 1) // 10
results = []
for _ in range(int(input())):
	(a, b) = map(int, input().split(' '))
	print(f(a, b))


t = int(input())
while t:
	l = [int(i) for i in input().split()]
	l.sort()
	c = l[1] - l[0]
	if l[0] == l[1]:
		print('0')
	elif l[0] < l[1]:
		d = c % 10
		c = (c - d) / 10
		if d == 0:
			print(int(c))
		else:
			print(int(c + 1))
	t -= 1


import math

def solve(a, b):
	return math.ceil(abs(b - a) / 10)
t = int(input())
for t in range(t):
	(a, b) = [int(s) for s in input().split()]
	result = solve(a, b)
	print(result)


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	k = abs(a - b)
	print(k // 10 + int(k % 10 != 0))


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	one = abs(b - a) // 10
	two = (b - a) % 10 != 0
	print(one + two)


from sys import stdin, stdout
from math import ceil

class SOLVE:

	def solve(self):
		R = stdin.readline
		W = stdout.write
		ans = []
		for i in range(int(input())):
			(a, b) = [int(x) for x in R().split()]
			ans += [str(ceil(abs(a - b) / 10))]
		W('\n'.join(ans))

def main():
	s = SOLVE()
	s.solve()
main()


ni = int(input())
for ki in range(ni):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
		continue
	if a < b:
		c = b - a
		if not c % 10:
			print(c // 10)
			continue
		print(c // 10 + 1)
		continue
	c = a - b
	if not c % 10:
		print(c // 10)
		continue
	print(c // 10 + 1)
	continue


from sys import stdin
from math import ceil
t = int(stdin.readline())
for _ in range(t):
	(a, b) = map(int, stdin.readline().split())
	if a == b:
		print(0)
	elif a > b:
		tmp = a - b
		print(int(ceil(tmp / 10)))
	elif a < b:
		tmp = b - a
		print(int(ceil(tmp / 10)))


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	if a > b:
		(a, b) = (b, a)
	result = 0
	while a < b:
		diff = b - a
		for i in reversed(range(1, 11)):
			if diff // i > 0:
				a += i * (diff // i)
				result += diff // i
				break
	print(result)


cases = int(input())
for i in range(cases):
	line = input().split(' ')
	a = int(line[0])
	b = int(line[1])
	diff = abs(a - b)
	sol = 0
	sol += diff // 10
	if diff % 10 > 0:
		sol += 1
	print(sol)


for i in range(int(input())):
	(a, b) = map(int, input().split())
	B = max(a, b)
	A = min(a, b)
	if (B - A) % 10 == 0:
		print(int((B - A) / 10))
	else:
		print(int((B - A) / 10 + 1))


from math import ceil
for i in range(int(input())):
	(lambda x: print(ceil(abs(x[0] - x[1]) / 10)))(list(map(int, input().split())))


for _ in range(int(input())):
	inp = [int(i) for i in input().split(' ')]
	a = inp[0]
	b = inp[1]
	m = min(a, b)
	a -= m
	b -= m
	if (a + b) % 10 == 0:
		print((a + b) // 10)
	else:
		print((a + b) // 10 + 1)


import sys
from collections import defaultdict as dd
from collections import deque
from functools import *
from fractions import Fraction as f
from copy import *
from bisect import *
from heapq import *
from math import *
from itertools import permutations, product

def eprint(*args):
	print(*args, file=sys.stderr)
zz = 1
if zz:
	input = sys.stdin.readline
else:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('all.txt', 'w')

def inc(d, c):
	d[c] = d[c] + 1 if c in d else 1

def bo(i):
	return ord(i) - ord('A')

def li():
	return [int(xx) for xx in input().split()]

def fli():
	return [float(x) for x in input().split()]

def comp(a, b):
	if a > b:
		return 2
	return 2 if a == b else 0

def gi():
	return [xx for xx in input().split()]

def fi():
	return int(input())

def pro(a):
	return reduce(lambda a, b: a * b, a)

def swap(a, i, j):
	(a[i], a[j]) = (a[j], a[i])

def si():
	return list(input().rstrip())

def mi():
	return map(int, input().split())

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

def isvalid(i, j):
	return 0 <= i < n and 0 <= j < n

def bo(i):
	return ord(i) - ord('a')

def graph(n, m):
	for i in range(m):
		(x, y) = mi()
		a[x].append(y)
		a[y].append(x)
t = fi()
while t > 0:
	t -= 1
	(a, b) = mi()
	print(abs(a - b) // 10 + int(abs(a - b) % 10 > 0))


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	count = 0
	while a != b:
		if a > b:
			if a - b >= 10:
				res = a - b
				count += res // 10
				a -= int(str(count) + '0')
			elif a - b < 10:
				a -= a - b
				count += 1
		elif b > a:
			if b - a >= 10:
				res = abs(b - a)
				count += res // 10
				a += int(str(count) + '0')
			elif b - a < 10:
				a += b - a
				count += 1
	print(count)


def f():
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	else:
		if a < b:
			(a, b) = (b, a)
		x = (a - b + 9) // 10
		print(x)
for i in range(int(input())):
	f()


num = int(input())
c = []
for _ in range(num):
	count = 0
	l1 = input().split()
	(a, b) = (max(int(l1[0]), int(l1[1])), min(int(l1[0]), int(l1[1])))
	diff = a - b
	strnum = str(diff)
	x = diff / 10
	p = diff % 10
	if p != 0:
		p = 1
	count = p + x
	c.append(int(count))
for i in c:
	print(i)


from functools import lru_cache
from sys import stdin, stdout
import sys
from math import *
for __ in range(int(input())):
	(a, b) = map(int, input().split())
	print(ceil(abs(a - b) / 10))


def moves(a, b):
	if a > b:
		return moves(b, a)
	if a == b:
		return 0
	num = 0
	while b - a > 10:
		f = (b - a) // 10
		num += f
		b = b - f * 10
	if b - a == 0:
		return num
	else:
		return num + 1
t = int(input())
while t:
	(a, b) = input().split()
	(a, b) = (int(a), int(b))
	print(moves(a, b))
	t -= 1


TC = int(input())
while TC > 0:
	(a, b) = list(map(int, input().split()))
	print((abs(b - a) + 9) // 10)
	TC -= 1


from sys import stdin
tc = int(stdin.readline())
for x in range(tc):
	(a, b) = [int(x) for x in stdin.readline().strip().split(' ')]
	if a == b:
		print(0)
	else:
		ans = abs(b - a) + 9
		print(ans // 10)


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	c = 0
	if a >= b:
		c = b
		b = a
		a = c
	r = b - a
	if r == 0:
		print(0)
	elif r < 10 and r != 0:
		print(1)
	elif r % 10 == 0:
		print(int(r / 10))
	else:
		print(int(r // 10 + 1))


t = int(input())
for _ in range(t):
	line = input()
	pui = line.split()
	a = int(pui[0])
	b = int(pui[1])
	dif = abs(a - b)
	s = int(dif / 10)
	if dif % 10 != 0:
		s += 1
	print(s)


from math import ceil
test = int(input())
for i in range(test):
	(a, b) = list(map(int, input().split()))
	if a == b:
		print(0)
	elif a > b:
		x = ceil((a - b) / 10)
		print(x)
	else:
		y = ceil((b - a) / 10)
		print(y)


import math

def arraysum(array1, array2):
	allsum = 0
	for i in range(len(array1)):
		allsum += abs(array1[i] - array2[i])
n = int(input())
for i in range(n):
	s = input().split(' ')
	a = int(s[0])
	b = int(s[1])
	print(int(math.ceil(abs(a - b) / 10)))


t = int(input())

def twointegers(a, b):
	if a == b:
		return 0
	if b - a < 10:
		return 1
	if (b - a) % 10 == 0:
		return (b - a) // 10
	return (b - a) // 10 + 1
for i in range(t):
	(a, b) = input().split()
	(a, b) = (min(int(a), int(b)), max(int(a), int(b)))
	print(twointegers(a, b))


t = int(input())
for _ in range(t):
	(a, b) = [int(x) for x in input().split()]
	r = abs(b - a) // 10
	if abs(b - a) % 10:
		r += 1
	print(r)


test = int(input())
for i in range(test):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	if a > b:
		c = a - b
		if c % 10 != 0:
			s = c // 10
			s += 1
			print(s)
		else:
			s = c // 10
			print(s)
	if b > a:
		c = b - a
		if c % 10 != 0:
			s = c // 10
			s += 1
			print(s)
		else:
			s = c // 10
			print(s)


import math
t = int(input())
for i in range(t):
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	count = 0
	res = math.ceil(abs((a - b) / 10))
	print(res)


import math
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	ans = abs(m - n)
	ans = math.ceil(ans / 10)
	print(ans)


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush, nsmallest
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
from decimal import Decimal
mod = pow(10, 9) + 7
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(var, end='\n'):
	sys.stdout.write(str(var) + end)

def outa(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
for _ in range(int(data())):
	(a, b) = sp()
	temp = abs(b - a)
	answer = temp // 10 + (1 if temp % 10 else 0)
	out(answer)


def two_nums():
	count = int(input())
	data_lst = []
	ans = []
	s = 0
	a = 0
	for i in range(count):
		data_lst = list(map(int, input().split()))
		if data_lst[0] > data_lst[1]:
			a = data_lst[0] - data_lst[1]
			if a % 10 == 0:
				ans.append(a // 10)
			else:
				ans.append(a // 10 + 1)
		elif data_lst[0] == data_lst[1]:
			ans.append(0)
		elif data_lst[0] < data_lst[1]:
			a = data_lst[1] - data_lst[0]
			if a % 10 == 0:
				ans.append(a // 10)
			else:
				ans.append(a // 10 + 1)
		data_lst = []
		s = 0
		a = 0
	for i in range(len(ans)):
		print(ans[i])
two_nums()


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	l = list(range(1, 11))
	if a == b:
		print('0')
	elif a < b:
		c = b - a
		count = 0
		for i in range(10, 0, -1):
			d = c // i
			count = count + d
			c = c % i
			if c == 0:
				break
		print(count)
	elif a > b:
		c = a - b
		count = 0
		for i in range(10, 0, -1):
			d = c // i
			count = count + d
			c = c % i
			if c == 0:
				break
		print(count)


t = int(input())
natija = []
for i in range(t):
	L = input().split(' ')
	a = int(L[0])
	b = int(L[1])
	if abs(a - b) % 10 == 0:
		natija.append(abs(a - b) // 10)
	else:
		natija.append(abs(a - b) // 10 + 1)
for i in range(t):
	print(natija[i])


w = int(input())
for i in range(w):
	(a, b) = tuple(map(int, input().split()))
	diff = abs(a - b)
	print((diff + 9) // 10)


from math import *
from collections import *
from itertools import *
from functools import *
from bisect import *
from heapq import *
from operator import *
from sys import *
setrecursionlimit(100000000)
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
		continue
	x = abs(b - a)
	ans = x // 10 + (1 if x % 10 else 0)
	print(ans)


an = 0
t = int(input())
for i in range(t):
	(x, y) = list(map(int, input().split()))
	if x != y:
		an = abs(x - y)
		ans = an // 10
		rem = an % 10
		if rem == 0:
			print(ans)
		else:
			print(ans + 1)
	else:
		print(0)


def yetAnother(a, b):
	if a == b:
		return 0
	else:
		return (max(a, b) - min(a, b)) // 10 + 1 if (max(a, b) - min(a, b)) % 10 != 0 else (max(a, b) - min(a, b)) // 10
n = int(input())
lst = []
for i in range(n):
	(l, m) = [int(x) for x in input().split()]
	lst.append(yetAnother(l, m))
for i in lst:
	print(i)


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
numeroCasos = inp()
inputs = []
for i in range(0, numeroCasos):
	entrada = list(map(int, input().split(' ')))
	inputs.append(entrada)

def calcularIntentos(a, b):
	diferencia = abs(b - a)
	if diferencia == 0:
		print(0)
	elif diferencia % 10 == 0:
		intentos = diferencia // 10
		print(intentos)
	else:
		intentos = diferencia // 10 + 1
		print(intentos)
for entrada in inputs:
	calcularIntentos(entrada[0], entrada[1])


from sys import stdin
import math

def readline():
	return stdin.readline()

def solve(a, b):
	m = abs(a - b)
	s = 0
	if m > 10:
		s = math.ceil(m / 10)
	elif m > 0:
		s = 1
	return s
tests = int(readline())
for t in range(0, tests):
	(a, b) = list(map(int, readline().rstrip('\n').split(' ')))
	print(solve(a, b))


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	if a < b:
		ans1 = (b - a) // 10
		ans2 = (b - a) % 10
		if ans2 == 0:
			ans3 = ans1
		else:
			ans3 = ans1 + 1
		print(ans3)
	elif a > b:
		ans1 = (a - b) // 10
		ans2 = (a - b) % 10
		if ans2 == 0:
			ans3 = ans1
		else:
			ans3 = ans1 + 1
		print(ans3)
	else:
		print(0)


T = int(input())
for _ in range(T):
	(a, b) = map(int, input().split())
	res = 0
	c = abs(a - b)
	for i in range(10, 0, -1):
		res += c // i
		c %= i
	print(res)


testCases = int(input())
for _ in range(testCases):
	l = list(map(int, input().split(' ')))
	(a, b) = (l[0], l[1])
	knt = 0
	if a - b < 0:
		diff = b - a
		knt += int(diff / 10)
		if diff % 10 != 0:
			knt += 1
	elif a - b > 0:
		diff = a - b
		knt += int(diff / 10)
		if diff % 10 != 0:
			knt += 1
	print(knt)


import math
g = int(input())
for t in range(g):
	(means, end) = map(int, input().split())
	c = (end - means) / 10
	print(math.ceil(abs(c)))


def s():
	t = int(input())
	while t:
		(a, b) = map(int, input().split(' '))
		tot = abs(a - b)
		if tot % 10 > 0:
			print(int(tot / 10) + 1)
		else:
			print(int(tot / 10))
		t = t - 1
s()


t = int(input())
for _ in range(t):
	(a, b) = sorted([int(i) for i in input().split()])
	print((b - a) // 10 + ((b - a) % 10 != 0))


import math
for i in range(int(input())):
	(a, b) = list(map(int, input().split()))
	print(math.ceil((max(a, b) - min(a, b)) / 10))


n = int(input())
for i in range(n):
	a = list(map(int, input().split()))
	a.sort()
	[a, b] = a
	if (b - a) % 10 > 0:
		ans = 1
	else:
		ans = 0
	ans += (b - a) // 10
	print(ans)


import math
t = int(input())
while t > 0:
	(a, b) = [int(i) for i in input().split()]
	if a == b:
		print(0)
		t -= 1
		continue
	else:
		if a > b:
			(a, b) = (b, a)
		x = b - a
		c = int(math.ceil(x / 10))
		print(c)
	t -= 1


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	(a, b) = (min(a, b), max(a, b))
	ans = (b - a) // 10 + ((b - a) % 10 > 0)
	print(ans)


x = int(input())
for i in range(0, x):
	(n, m) = [int(a) for a in input().split()]
	d = abs(n - m)
	if d > 10:
		if d % 10 == 0:
			print(d // 10)
		else:
			print(d // 10 + 1)
	elif d == 0:
		print(d)
	else:
		print(1)


from math import ceil
for i in range(int(input())):
	(a, b) = map(int, input().split())
	v = abs(a - b)
	moves = v // 10
	val = v % 10
	if val > 0:
		moves += 1
	print(moves)


import sys
import os.path
if os.path.exists('in.txt'):
	sys.stdin = open('in.txt', 'r')
	sys.stdout = open('out.txt', 'w')
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	dis = abs(a - b)
	ans = dis // 10
	if dis % 10 == 0:
		print(ans)
	else:
		print(ans + 1)


t = int(input())
a = []
b = []
for i in range(t):
	c = input()
	a.append(int(c.split(' ')[0]))
	b.append(int(c.split(' ')[1]))
for i in range(len(a)):
	if b[i] - a[i] != 0:
		if b[i] - a[i] > 0:
			if b[i] - a[i] > 10:
				k = (b[i] - a[i]) // 10
				if b[i] - a[i] - k * 10 <= 0:
					print(k)
				else:
					print(k + 1)
			else:
				print(1)
		elif a[i] - b[i] > 10:
			k = (a[i] - b[i]) // 10
			if a[i] - b[i] - k * 10 <= 0:
				print(k)
			else:
				print(k + 1)
		else:
			print(1)
	else:
		print(0)


for i in range(int(input())):
	(p, q) = list(map(int, input().split()))
	c = 0
	a = min(p, q)
	b = max(p, q)
	while a != b:
		if abs(b - a) >= 10:
			x = abs(b - a) // 10
			b -= 10 * x
			c += x
		else:
			b -= abs(b - a)
			c += 1
	print(c)


def min_count(a, b):
	k = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
	count = 0
	if a == b:
		return 0
	else:
		tmp = abs(a - b)
		if int(tmp % 10) != 0:
			return int(tmp / 10) + 1
		else:
			return int(tmp / 10)
t = int(input())
res = []
for _ in range(t):
	(a, b) = input().rstrip().split()
	res.append(min_count(int(a), int(b)))
for i in res:
	print(i)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(l, r) = map(int, input().split())
	diff = abs(l - r)
	ans = 0
	ans += diff // 10
	diff %= 10
	ans += diff // 9
	diff %= 9
	ans += diff // 8
	diff %= 8
	ans += diff // 7
	diff %= 7
	ans += diff // 6
	diff %= 6
	ans += diff // 5
	diff %= 5
	ans += diff // 4
	diff %= 4
	ans += diff // 3
	diff %= 3
	ans += diff // 2
	diff %= 2
	ans += diff // 1
	diff %= 1
	print(ans)


import sys
for _ in range(int(input())):
	(a, b) = [int(i) for i in input().split()]
	diff = abs(b - a)
	ans = diff // 10
	if diff % 10 != 0:
		ans += 1
	print(ans)


t = int(input())
for case in range(t):
	(a, b) = input().split(' ')
	(a, b) = (int(a), int(b))
	if a < b:
		print((b - a - 1) // 10 + 1)
	else:
		print((a - b - 1) // 10 + 1)


import sys
input = sys.stdin.readline
for n in range(int(input())):
	(a, b) = map(int, input().split())
	d = abs(a - b)
	if d % 10 == 0:
		print(d // 10)
	else:
		print(d // 10 + 1)


n = int(input())
i = 0
b = []
while i < n:
	x = input()
	b.append(x)
	i = i + 1
for word in b:
	k = 0
	y = word.split(' ')
	p = abs(int(y[1]) - int(y[0]))
	if p <= 10 and p != 0:
		print('1')
	elif p == 0:
		print('0')
	elif p > 10:
		k = k + p // 10
		if p % 10 > 0:
			k = k + 1
			print(k)
		elif p % 10 == 0:
			print(k)


t = int(input())
for i in range(t):
	(a, b) = [int(j) for j in input().split()]
	d = abs(a - b)
	if d % 10 == 0:
		t1 = d // 10
	else:
		t1 = d // 10 + 1
	print(t1)


for i in range(int(input())):
	(a, b) = map(int, input().split())
	k = 0
	c = max(a, b) - min(a, b)
	k += c // 10
	c %= 10
	if c != 0:
		k += 1
	print(k)


def readGenerator():
	while True:
		tokens = input().split(' ')
		for t in tokens:
			yield t
reader = readGenerator()

def readWord():
	return next(reader)

def readInt():
	return int(next(reader))

def readFloat():
	return float(next(reader))

def readLine():
	return input()

def solve(n):
	return n

def solve(a, b):
	return abs(a - b) // 10 + (0 if abs(a - b) % 10 == 0 else 1)
tests = readInt()
for _ in range(0, tests):
	a = readInt()
	b = readInt()
	print(solve(a, b))


test_cases = int(input())
results = []
for t in range(test_cases):
	nums = list(map(int, input().split()))
	(a, b) = (min(nums), max(nums))
	moves = 0
	for k in range(10, 0, -1):
		temp = (b - a) // k
		a += k * temp
		moves += temp
		if a == b:
			results.append(moves)
			break
for res in results:
	print(res)


import sys
read = lambda : sys.stdin.readline().strip()
from math import ceil
for _ in range(int(read())):
	(a, b) = map(int, read().split())
	print(ceil(abs(a - b) / 10))


test = int(input())
for i in range(0, test):
	ab = input().split()
	a = int(ab[0])
	b = int(ab[1])
	diff = abs(b - a)
	if diff > 0:
		val = int(diff % 10)
		if val > 0:
			val = 1
		else:
			val = 0
		val1 = int(diff / 10)
		ans = val1 + val
		print(ans)
	elif diff == 0:
		print('0')


n = int(input())
for _ in range(n):
	(a, b) = map(int, input().split())
	ba = b - a
	ab = a - b
	if a == b:
		print(0)
	elif a < b:
		print(ba // 10 + (0 if ba / 10 % 1 == 0 else 1))
	else:
		print(ab // 10 + (0 if ab / 10 % 1 == 0 else 1))


import math
T = int(input())
for i in range(T):
	(a, b) = map(int, input().split())
	diff = max(a, b) - min(a, b)
	ans = math.ceil(diff / 10)
	print(ans)


t = int(input())
import math
for i in range(t):
	(m, n) = map(int, input().split())
	x = (max(m, n) - min(m, n)) / 10
	if math.ceil(x) == math.floor(x):
		print(int(x))
	else:
		print(int(x) + 1)


def func(a, b):
	s = 0
	x = a - b
	x //= 10
	s += x
	if (a - b) % 10:
		s += 1
	return s
n = int(input())
i = 0
while i < n:
	(a, b) = map(int, input().split())
	if a < b:
		(a, b) = (b, a)
	print(func(a, b))
	i += 1


n = int(input())
arr = []
for i in range(n):
	arr.append(list(map(int, input().split(' '))))
for i in range(len(arr)):
	prev = 0
	cur = arr[i]
	if cur[1] == cur[0]:
		print(0)
		continue
	start = min(cur[0], cur[1])
	end = max(cur[0], cur[1])
	count = 0
	while start != end:
		if start + 20 <= end:
			count = (end - start) // 20 * 2
			end = (end - start) % 20
			start = 0
		elif start + 10 <= end and prev != 10:
			count += 1
			start += 10
			prev = 10
		else:
			count += 1
			start = end
	print(count)


import sys, math
from collections import deque, defaultdict
import operator as op
from functools import reduce
sys.setrecursionlimit(10 ** 6)
I = sys.stdin.readline

def ii():
	return int(I().strip())

def li():
	return list(map(int, I().strip().split()))

def mi():
	return map(int, I().strip().split())

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer // denom

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

def main():
	ans = ''
	for _ in range(ii()):
		(a, b) = mi()
		if a == b:
			ans += '0\n'
		else:
			x = abs(a - b)
			tmp = x // 10
			r = x % 10
			if r != 0:
				ans += str(tmp + 1) + '\n'
			else:
				ans += str(tmp) + '\n'
	print(ans)
main()


t = int(input())
data = []
for i in range(t):
	count = 0
	(a, b) = map(int, input().split())
	if a == b:
		data.append(count)
	elif b > a:
		d = b - a
		if d > 10:
			quo = d // 10
			rem = d % 10
			if rem == 0:
				count = count + quo
			else:
				count = count + quo + 1
			data.append(count)
		else:
			count = count + 1
			data.append(count)
	else:
		d = a - b
		if d > 10:
			quo = d // 10
			rem = d % 10
			if rem == 0:
				count = count + quo
			else:
				count = count + quo + 1
			data.append(count)
		else:
			count = count + 1
			data.append(count)
for var in data:
	print(var)


ntest_case = int(input())
output = []
for _ in range(ntest_case):
	abpair = [int(a) for a in input().split(' ')]
	if abpair[0] == abpair[1]:
		output.append(0)
	elif abpair[0] < abpair[1] or abpair[0] > abpair[1]:
		diff = abs(abpair[0] - abpair[1])
		if diff <= 10:
			output.append(1)
		else:
			moves = int(diff / 10)
			moves += 0 if diff % 10 == 0 else 1
			output.append(moves)
for i in output:
	print(i)


from sys import stdin
import math

def get_int():
	return int(stdin.readline())

def get_str():
	return stdin.readline().strip()

def get_ints():
	return map(int, stdin.readline().strip().split())

def get_array():
	return list(map(int, stdin.readline().strip().split()))

def get_array2d(row):
	return [list(map(int, stdin.readline().strip().split())) for _ in range(row)]
T = get_int()
for _ in range(T):
	(a, b) = get_ints()
	ans = math.ceil(abs(b - a) / 10)
	print(ans)


from collections import Counter
from collections import OrderedDict
from collections import defaultdict

def SOCountR(mylist):
	return OrderedDict(sorted(Counter(mylist).items(), reverse=True))

def SOCount(mylist):
	return OrderedDict(sorted(Counter(mylist).items()))

def freq_count(mylist):
	return Counter(mylist)
t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	diff = abs(b - a)
	val = diff // 10
	if diff % 10 == 0:
		print(val)
	else:
		print(val + 1)


def solve(x, y):
	if x == y:
		return 0
	if x < y:
		(x, y) = (y, x)
	return int((x - y - 1) / 10) + 1
t = int(input())
for i in range(t):
	(x, y) = map(int, input().split(' '))
	print(solve(x, y))


def driver(x, y):
	if x > y:
		(x, y) = (y, x)
	if x == y:
		print(0)
		return
	z = y - x
	p = z // 10
	if z % 10 == 0:
		print(p)
	else:
		print(p + 1)

def main():
	for i in range(int(input())):
		(x, y) = map(int, input().split(' '))
		driver(x, y)
main()


import math
tc = int(input())
while tc > 0:
	(a, b) = [int(x) for x in input().split()]
	if a == b:
		print(0)
	else:
		print(math.ceil(abs(a - b) / 10))
	tc = tc - 1


def main():
	t = input()
	for i in range(0, int(t)):
		(a, b) = input().split()
		if a == b:
			print(0)
		else:
			diff = abs(int(a) - int(b))
			steps = int(diff / 10)
			if int(diff % 10) > 0:
				steps += 1
			print(steps)
main()


from math import *
from bisect import *
from collections import Counter, defaultdict, deque
from sys import stdin, stdout
input = stdin.readline
I = lambda : int(input())
M = lambda : map(int, input().split())
LI = lambda : list(map(int, input().split()))
for _ in range(I()):
	(a, b) = M()
	c = abs(a - b)
	print(ceil(c / 10))


T = int(input())
while T != 0:
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	if a > b:
		if (a - b) % 10 == 0:
			print(int((a - b) / 10))
		else:
			print(int((a - b) / 10) + 1)
	elif (b - a) % 10 == 0:
		print(int((b - a) / 10))
	else:
		print(int((b - a) / 10) + 1)
	T -= 1


from math import log2, ceil
from heapq import heappush, heappop, heapify
from copy import deepcopy
from collections import deque, Counter as CC

def main():
	for t in range(int(input())):
		(a, b) = [int(j) for j in input().split()]
		print((abs(a - b) + 9) // 10)
main()


from math import *
count = int(0)
ans_list = list()
t = int(input())
inp_count = t
list_a = list()
list_b = list()
while inp_count != 0:
	(a, b) = input().split()
	list_a.append(int(a))
	list_b.append(int(b))
	inp_count -= 1
inp_count = t
i = int(0)
if i < len(list_a):
	while inp_count != 0:
		count = int(0)
		inp_count -= 1
		if int(list_a[i]) == int(list_b[i]):
			ans_list.append(count)
		elif int(list_a[i]) < int(list_b[i]):
			ans = int(list_b[i]) - int(list_a[i])
			ans = ceil(ans / 10)
			ans_list.append(ans)
		elif int(list_a[i]) > int(list_b[i]):
			ans = int(list_a[i]) - int(list_b[i])
			ans = ceil(ans / 10)
			ans_list.append(ans)
		i += 1
for item in ans_list:
	print(item)


from sys import stdin, stdout
import math
import re
import itertools
import collections
for _ in range(int(input())):
	(a, b) = map(int, input().rstrip().split())
	diff = abs(a - b)
	diff_mod_10 = diff % 10
	change = 0
	if diff_mod_10 == 0:
		pass
	else:
		change += 1
		diff = diff - diff_mod_10
	change += diff // 10
	print(change)


t = int(input())
for i in range(t):
	(x, y) = [int(x) for x in input().split()]
	z = abs(y - x)
	e = z % 10
	z = z // 10
	if e:
		z += 1
	ans = z
	print(ans)


for i in range(int(input())):
	(a, b) = map(int, input().split())
	c = 0
	if b > a:
		while a < b:
			if a + 10 <= b:
				temp = b - a
				x = temp // 10
				a = a + x * 10
				c += x
			elif a + 9 <= b:
				a = a + 9
				c += 1
			elif a + 8 <= b:
				a = a + 8
				c += 1
			elif a + 7 <= b:
				a = a + 7
				c += 1
			elif a + 6 <= b:
				a = a + 6
				c += 1
			elif a + 5 <= b:
				a = a + 5
				c += 1
			elif a + 4 <= b:
				a = a + 4
				c += 1
			elif a + 3 <= b:
				a = a + 3
				c += 1
			elif a + 2 <= b:
				a = a + 2
				c += 1
			elif a + 1 <= b:
				a = a + 1
				c += 1
	else:
		while a > b:
			if a - 10 >= b:
				temp = a - b
				x = temp // 10
				a = a - x * 10
				c += x
			elif a - 9 >= b:
				a = a - 9
				c += 1
			elif a - 8 >= b:
				a = a - 8
				c += 1
			elif a - 7 >= b:
				a = a - 7
				c += 1
			elif a - 6 >= b:
				a = a - 6
				c += 1
			elif a - 5 >= b:
				a = a - 5
				c += 1
			elif a - 4 >= b:
				a = a - 4
				c += 1
			elif a - 3 >= b:
				a = a - 3
				c += 1
			elif a - 2 >= b:
				a = a - 2
				c += 1
			elif a - 1 >= b:
				a = a - 1
				c += 1
	print(c)


from collections import *
from sys import stdin, stderr

def rl():
	return [int(w) for w in stdin.readline().split()]
for _ in range(rl()[0]):
	(a, b) = rl()
	print((abs(a - b) - 1) // 10 + 1)


t = int(input())
count = 0
k = 0
m = 0
n = 0
for i in range(t):
	(a, b) = map(int, input().split())
	if a == b:
		count = 0
		print(count)
	elif a > b:
		k = a - b
		m = k // 10
		n = k % 10
		if n == 0:
			count = m
		else:
			count = m + 1
		print(count)
	else:
		k = b - a
		m = k // 10
		n = k % 10
		if n == 0:
			count = m
		else:
			count = m + 1
		print(count)


from math import ceil
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	d = abs(a - b)
	if d % 10 == 0:
		d //= 10
	else:
		d = ceil(d / 10)
	print(d)


from math import *
from cmath import *
from itertools import *
from decimal import *
from fractions import *
from sys import *
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	if n < k:
		(n, k) = (k, n)
	print((n - k) // 10 + ((n - k) % 10 != 0))


arr = [0] * 11
for i in range(1, 11):
	arr[i] = arr[i - 1] + i
T = int(input())
for _ in range(T):
	(a, b) = list(map(int, input().split()))
	if a > b:
		req = a - b
	else:
		req = b - a
	if req % 10 == 0:
		count = req // 10
	else:
		count = req // 10
		count += 1
	print(count)


from collections import Counter
from math import log, e, inf
t = int(input())
while t:
	t -= 1
	(a, b) = map(int, input().split(' '))
	s = 0
	x = max(a, b)
	y = min(a, b)
	x = x - y
	s = x // 10
	x = x % 10
	if x > 0:
		s += 1
	print(s)


def chislo(a, b, count):
	if a > b:
		(a, b) = (b, a)
	if a < b:
		count += (b - a) // 10
		if (b - a) % 10 in range(1, 10):
			count += 1
			return count
		else:
			return count
	else:
		return count
_list = []
n = int(input())
for i in range(0, n):
	(a, b) = input().split(' ', 1)
	count = 0
	_list.append(chislo(int(a), int(b), count))
for i in _list:
	print(i)


import sys
INP = lambda : sys.stdin.readline().strip()
INT = lambda : int(INP())
MAP = lambda : map(int, INP().split())
ARR = lambda : [int(i) for i in INP().split()]

def JOIN(arr, x=' '):
	return x.join([str(i) for i in arr])

def EXIT(x='NO'):
	print(x)
	exit()
from math import ceil
for _ in range(INT()):
	(a, b) = MAP()
	print(ceil(abs(b - a) / 10))


x = int(input())
for i in range(x):
	k = list(map(int, input().split()))
	k.sort()
	print((k[1] - k[0]) // 10 + 1) if (k[1] - k[0]) % 10 != 0 else print((k[1] - k[0]) // 10)


def main():
	T = int(input())
	for i in range(T):
		(a, b) = list(map(int, input().split()))
		if b < a:
			(a, b) = (b, a)
		cnt = (b - a) // 10
		if not (b - a) % 10:
			print(cnt)
		else:
			print(cnt + 1)
main()


def create_cases(data1, data2):
	cases = []
	answers = []
	data1 = data1.split('\n')
	data2 = data2.split('\n')
	for i in data1:
		x = list(map(int, i.split()))
		x.sort()
		cases.append(x)
	for i in data2:
		answers.append(i.strip())
	answers = list(map(int, answers))
	return (cases, answers)

def f(cases):
	answers = []
	for case in cases:
		n = 0
		x = case[1] - case[0]
		for i in range(10, 0, -1):
			if x == 0:
				break
			n += x // i
			x = x % i
		answers.append(n)
	return [_ for _ in answers]
n = int(input())
cases = []
for _ in range(n):
	x = list(map(int, input().split()))
	x.sort()
	cases.append(x)
answers = f(cases)
for i in answers:
	print(i)


import math
n = int(input())
imp = []
for i in range(n):
	(a, b) = map(int, input().split(' '))
	imp.append([a, b])

def find(x):
	count = 0
	if x == 0:
		return 0
	count = math.ceil(x / 10)
	return count
for x in imp:
	a = x[0]
	b = x[1]
	if a > b:
		diff = a - b
		print(find(diff))
	else:
		diff = b - a
		print(find(diff))


import math, sys, os, collections, functools
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
for testcase in range(int(input())):
	(a, b) = map(int, input().split())
	x = 1
	if (b - a) % 10 == 0:
		x = 0
	print(abs(b - a) // 10 + x)


import math
t = int(input())
for i in range(t):
	arr = [int(x) for x in input().split()]
	(a, b) = (arr[0], arr[1])
	d = abs(a - b)
	if d % 10:
		print(d // 10 + 1)
	else:
		print(d // 10)


def abs(x):
	if x > 0:
		return x
	return -x
t = int(input())
for i in range(t):
	string = input()
	list1 = string.split()
	A = [int(i) for i in list1]
	print((abs(A[1] - A[0]) - 1) // 10 + 1)


from math import *
t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	ans = abs(a - b)
	if ans > 10:
		print(ceil(ans / 10))
	elif a == b:
		print(0)
	else:
		print(1)


t = int(input())
for i in range(0, t):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	elif a > b:
		p = a - b
		if p <= 10:
			print(1)
		else:
			v = p // 10
			w = p % 10
			if w == 0:
				print(v)
			else:
				print(v + 1)
	else:
		q = b - a
		if q <= 10:
			print(1)
		else:
			y = q // 10
			m = q % 10
			if m == 0:
				print(y)
			else:
				print(y + 1)


import os
import sys
import math
import heapq
from decimal import *
from io import BytesIO, IOBase
from collections import defaultdict, deque

def r():
	return int(input())

def rm():
	return map(int, input().split())

def rl():
	return list(map(int, input().split()))
for _ in range(r()):
	(a, b) = rm()
	print(math.ceil(abs(a - b) / 10))


for _ in range(int(input())):
	(a, b) = [int(__) for __ in input().split()]
	diff = abs(a - b)
	l1 = list(range(1, 11))[::-1]
	ans = 0
	for i in l1:
		if diff >= i:
			ans += diff // i
			diff %= i
	print(ans)


t = int(input())
for i in range(t):
	(a, b) = (int(x) for x in input().split())
	if a < b:
		tmp = a
		a = b
		b = tmp
	dif = (a - b) // 10
	if (a - b) % 10:
		dif = dif + 1
	print(dif)


n = int(input())
ans = []
for _ in range(n):
	(a, b) = map(int, input().split())
	(x, y) = divmod(abs(b - a), 10)
	ans.append(x + 1 if y != 0 else x)
print('\n'.join(map(str, ans)))


import sys
t = int(input())
for _ in range(t):
	(a, b) = list(map(int, input().split()))
	ans = abs(a - b) // 10
	if abs(a - b) % 10 != 0:
		ans += 1
	print(ans)


for i in range(int(input())):
	(a, b) = [int(o) for o in input().split()]
	(n, c) = (abs(b - a), 0)
	if n >= 10:
		c += n // 10
		n = n % 10
	if n >= 9:
		c += n // 9
		n = n % 9
	if n >= 8:
		c += n // 8
		n = n % 8
	if n >= 7:
		c += n // 7
		n = n % 7
	if n >= 6:
		c += n // 6
		n = n % 6
	if n >= 5:
		c += n // 5
		n = n % 5
	if n >= 4:
		c += n // 4
		n = n % 4
	if n >= 3:
		c += n // 3
		n = n % 3
	if n >= 2:
		c += n // 2
		n = n % 2
	if n >= 1:
		c += n // 1
		n = n % 1
	if n == 0:
		print(c)


t = int(input())
for ini in range(t):
	(a, b) = list(map(int, input().split(' ')))
	delta = abs(a - b)
	moves = 0
	if delta == 0:
		moves = 0
	elif delta <= 10:
		moves = 1
	else:
		moves = delta // 10
		if delta % 10 != 0:
			moves += 1
	print(moves)


T = int(input())
res = list()
for i in range(T):
	x = list(map(int, input().split()))
	res.append(x)
for i in range(len(res)):
	diff = abs(res[i][1] - res[i][0])
	count = diff // 10
	m = diff % 10
	if m > 0:
		count += 1
	print(count)


import sys
ii = lambda : sys.stdin.readline().strip()
idata = lambda : [int(x) for x in ii().split()]

def solve():
	(a, b) = idata()
	print((abs(a - b) + 9) // 10)
	return
for t in range(int(ii())):
	solve()


from sys import stdin

def main():
	input = lambda : stdin.readline()[:-1]
	T = int(input())
	for _ in [0] * T:
		(A, B) = map(int, input().split())
		d = abs(B - A)
		ans = (d + 9) // 10
		print(ans)
main()


n = int(input())
num = []
for _ in range(n):
	s = [int(i) for i in input().split()]
	num.append(abs(s[0] - s[1]))
for i in range(n):
	ip = num[i]
	if ip == 0:
		print(0)
	else:
		count = 0
		if ip >= 10:
			c = ip // 10
			if ip % 10 == 0:
				count = count + c
			else:
				count = count + c + 1
		else:
			count = 1
		print(count)


import sys
input = sys.stdin.readline
INF = float('inf')
tc = int(input())
for _ in range(tc):
	(a, b) = map(int, input().split())
	ans = abs(b - a) // 10 if abs(b - a) % 10 == 0 else abs(b - a) // 10 + 1
	print(ans)


import os
import sys
debug = True
if debug and os.path.exists('input.in'):
	input = open('input.in', 'r').readline
else:
	debug = False
	input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return s[:len(s) - 1]

def invr():
	return map(int, input().split())
test_count = inp()
for t in range(test_count):
	if debug:
		print('Test Case #', t + 1)
	(a, b) = invr()
	d = abs(a - b)
	print(d // 10 + (1 if d % 10 > 0 else 0))


z = int(input())
for y in range(z):
	(a, b) = map(int, input().split())
	c = abs(a - b)
	if c % 10 == 0:
		print(int(c / 10))
	else:
		print(int(c // 10 + 1))


from collections import defaultdict as dc
from collections import Counter
import sys
import math
input = sys.stdin.readline
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	x = abs(a - b)
	print(x // 10 + min(x % 10, 1))


def solve(n):
	if n % 10 == 0:
		return n // 10
	return n // 10 + 1
t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	if a > b:
		x = a - b
		print(solve(x))
	elif a < b:
		x = b - a
		print(solve(x))


t = int(input())
for i in range(t):
	(a, b) = list(map(int, input().split()))
	ctr = 0
	k = abs(b - a)
	if k == 0:
		print(0)
	elif k % 10 == 0:
		print(k // 10)
	else:
		print(k // 10 + 1)


n = int(input())
for t in range(n):
	(a, b) = list(map(int, input().split()))
	c = abs(a - b)
	i = 0
	if c % 10 != 0:
		i = 1
	d = c // 10 + i
	print(d)


MOD = 1000000007
from collections import defaultdict as dd, Counter, deque

def si():
	return input()

def ii():
	return int(input())

def li():
	return list(map(int, input().split()))

def mi():
	return map(int, input().split())

def out(v):
	print(v)

def spout():
	print(v, end=' ')

def d2b(n):
	return bin(n).replace('0b', '')

def twod(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def vow():
	return ['a', 'e', 'i', 'o', 'u']

def let():
	return [chr(i) for i in range(97, 123)]

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

def ispow2(x):
	return x and (not x & x - 1)

def prime_factors(n):
	i = 2
	factors = []
	while i * i <= n:
		if n % i:
			i += 1
		else:
			n //= i
			factors.append(i)
	if n > 1:
		factors.append(n)
	return list(factors)
t = ii()
while t:
	t -= 1
	(a, b) = mi()
	(a, b) = (max(a, b), min(a, b))
	if a == b:
		print(0)
	else:
		d = a - b
		if d % 10 == 0:
			print(d // 10)
		else:
			print(d // 10 + 1)


t = int(input())
while t:
	t -= 1
	z = list(map(int, input().split()))
	(a, b) = (z[0], z[1])
	count = 0
	start = 1
	end = 10
	while a != b:
		if a < b:
			if b - a >= 10:
				x = (b - a) // 10
				count += x
				a += 10 * x
			else:
				a += b - a
				count += 1
		elif b - a <= -10:
			x = (a - b) // 10
			count += x
			a -= 10 * x
		else:
			a += b - a
			count += 1
	print(count)


from sys import *
from math import ceil
ws = lambda : map(int, stdin.readline().strip().split())
li = lambda : list(map(int, stdin.readline().strip().split()))
mod = 1000000007

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

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def prod(l):
	ans = 1
	for i in range(len(l)):
		ans = ans * l[i]
	return ans

def sortindex(l, a):
	c = []
	if a == -1:
		rev = True
	else:
		rev = False
	for i in range(len(l)):
		c.append([l[i], i])
	x = sorted(c, reverse=rev)
	print(x)
	c = []
	for i in range(len(l)):
		c.append(x[i][1])
	return c
for testcases in range(int(input())):
	(a, b) = ws()
	if a == b:
		print(0)
		continue
	if a > b:
		temp = a - b
	else:
		temp = b - a
	print(ceil(temp / 10))


from collections import Counter
from math import ceil
a = ord('a')
alph = [chr(i) for i in range(a, a + 26)]
li = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
for _ in range(int(input())):
	(a, b) = list(map(int, input().strip().split()))
	print(ceil(abs(a - b) / 10))


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if b > a:
		(a, b) = (b, a)
	d = a - b
	out = d // 10
	d %= 10
	if d > 0:
		out += 1
	print(out)


import sys
from collections import defaultdict
name = sys.stdin.read()
jobGrid = []
isJob = True
row = []
grid = name.split('\n')
grid = grid[:-1]
number_of_cases = int(grid[0])
for i in range(1, number_of_cases + 1):
	case = [int(x) for x in grid[i].split(' ')]
	diff = abs(case[0] - case[1])
	ans = diff // 10
	if diff % 10 != 0:
		ans += 1
	print(ans)


for i in range(int(input())):
	(a, b) = tuple(map(int, input().split()))
	(b, a) = (max(b, a), min(b, a))
	if (b - a) % 10 != 0:
		print(abs((b - a) // 10 + 1))
	else:
		print(abs((b - a) // 10))


import math
for ad in range(int(input())):
	(a, b) = list(map(int, input().split()))
	x = math.ceil(abs(a - b) / 10)
	print(x)


import math as m
t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	s = abs(b - a)
	print(m.ceil(s / 10))


def func(a, b):
	target = abs(b - a)
	if target is 0:
		return 0
	if target < 11:
		return 1
	if target % 10 is 0:
		return target // 10
	current = target // 10
	return current + 1
t = int(input())
while t > 0:
	x = list(map(int, input().strip().split(' ')))
	(a, b) = (x[0], x[1])
	print(func(a, b))
	t -= 1


def read_int():
	return int(input().strip())

def read_ints():
	return list(map(int, input().strip().split()))

def read_string():
	return input()

def read_strings():
	return input().strip().split()

def swap(x, y):
	return (y, x)

def solve():
	(a, b) = read_ints()
	if a > b:
		(a, b) = swap(a, b)
	diff = b - a
	if diff % 10 > 0:
		add = 1
	else:
		add = 0
	print(diff // 10 + add)

def read_input():
	t = read_int()
	for _ in range(t):
		solve()
read_input()


import math
x = int(input())
for i in range(0, x):
	(a, b) = input().split(' ')
	a = int(a)
	b = int(b)
	print(math.ceil(abs(a - b) / 10))


t = int(input())
while t > 0:
	t = t - 1
	(n, m) = map(int, input().split())
	l = max(n, m)
	p = min(n, m)
	x = l - p
	x = x / 10
	if x.is_integer():
		print(int(x))
	else:
		print(int(x) + 1)


def ooo(a, b):
	if b < a:
		(a, b) = (b, a)
	c = b - a
	if c % 10 == 0:
		return c // 10
	return int(c // 10 + 1)
t = int(input())
r = []
for i in range(t):
	x = [int(i) for i in input().split()]
	print(ooo(x[0], x[1]))


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__
t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	diff = abs(a - b)
	print((diff + 10 - 1) // 10)


import math
for _ in range(int(input())):
	s = input().split()
	d = abs(int(s[0]) - int(s[1]))
	print(math.ceil(d / 10))


def read_ints():
	return map(int, input().split(' '))
t = int(input())
for i in range(t):
	(a, b) = read_ints()
	distancia = abs(a - b)
	vezes = distancia // 10
	if distancia % 10 != 0:
		vezes += 1
	print(vezes)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import math
from collections import Counter, defaultdict, deque

def int1():
	return int(input())

def map1():
	return map(int, input().split())

def list1():
	return list(map(int, input().split()))
mod = pow(10, 9) + 7

def solve():
	(a, b) = map1()
	x = abs(a - b)
	v = math.ceil(x / 10)
	print(v)
for _ in range(int(input())):
	solve()


t = int(input())
i = 1
while i <= t:
	(a, b) = map(int, input().split())
	diff = abs(a - b)
	tens = diff // 10
	if diff % 10 == 0:
		print(tens)
	else:
		print(tens + 1)
	i += 1


t = int(input())
for i in range(t):
	(a, b) = list(map(int, input().split()))
	d = abs(b - a)
	move = 0
	if d / 10 > 0:
		move = move + d // 10
		d = d % 10
	if d / 9 > 0:
		move = move + d // 9
		d = d % 9
	if d / 8 > 0:
		move = move + d // 8
		d = d % 8
	if d / 7 > 0:
		move = move + d // 7
		d = d % 7
	if d / 6 > 0:
		move = move + d // 6
		d = d % 6
	if d / 5 > 0:
		move = move + d // 5
		d = d % 5
	if d / 4 > 0:
		move = move + d // 4
		d = d % 4
	if d / 3 > 0:
		move = move + d // 3
		d = d % 3
	if d / 2 > 0:
		move = move + d // 2
		d = d % 2
	if d / 1 > 0:
		move = move + d // 1
		d = d % 1
	print(move)


def solve(a, b):
	if a == b:
		return 0
	p = b - a
	if p % 10 == 0:
		return p // 10
	return p // 10 + 1
for _ in range(int(input())):
	(a, b) = sorted(map(int, input().split()))
	print(solve(a, b))


def solve(a, b):
	if a == b:
		return 0
	if b < a:
		return solve(a=b, b=a)
	d = b - a
	ans = d // 10
	if d % 10 != 0:
		ans += 1
	return ans
t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	print(solve(a, b))


def min_moves(a, b):
	n = abs(a - b)
	if n % 10 > 0:
		print(n // 10 + 1)
	else:
		print(n // 10)
x = input()
for i in range(int(x)):
	values = input().split(' ')
	min_moves(int(values[0]), int(values[1]))


t_case = int(input())
for _ in range(t_case):
	(a, b) = map(int, input().split())
	diff = abs(a - b)
	moves = diff // 10
	if diff % 10:
		moves += 1
	print(moves)


n = int(input())
for i in range(n):
	(a, b) = map(int, input().split())
	s = max(a, b)
	b = min(a, b)
	if (s - b) % 10 == 0:
		print((s - b) // 10)
	else:
		print((s - b) // 10 + 1)


def solve():
	(a, b) = map(int, input().split())
	if a == b:
		return 0
	if a > b:
		diff = a - b
	diff = abs(a - b)
	if diff <= 10:
		return 1
	moves = 0
	p = diff // 10
	moves += p
	if diff % 10 != 0:
		moves += 1
	return moves
for _ in range(int(input())):
	print(solve())


def cnt(a, d):
	count = 0
	if d - a < 10:
		count += 1
	elif d - a > 10:
		c = (d - a) // 10
		if (d - a) % 10 == 0:
			count += c
		else:
			count += c + 1
	return count
b = int(input())
for i in range(0, b):
	(p, q) = input().split()
	p = int(p)
	q = int(q)
	if p - q == 10 or q - p == 10:
		print(1)
	elif p < q:
		print(cnt(p, q))
	elif p > q:
		p = p * -1
		q = q * -1
		print(cnt(p, q))
	elif p == q:
		print(0)


t = int(input())
res = []
for i in range(t):
	(m, n) = map(int, input().split())

	def solve(m, n, ct):
		if m == n:
			return ct
		else:
			if n >= m:
				num = n - m
			if n < m:
				num = m - n
			rem = num % 10
			q = num // 10
			if num <= 10:
				ct += 1
			elif num > 10:
				ct += q
				if rem != 0:
					ct += 1
			return ct
	res.append(solve(m, n, 0))
for _ in range(t):
	print(res[_])


import sys

def calc(a, b):
	if a > b:
		c = (a - b) // 10 + (0 if (a - b) % 10 == 0 else 1)
	elif a == b:
		c = 0
	else:
		c = (b - a) // 10 + (0 if (b - a) % 10 == 0 else 1)
	return c
t = int(input())
for x in range(0, t):
	(a, b) = map(int, input().split())
	c = calc(a, b)
	print(c)


def findways(inputNum):
	x = inputNum[0]
	y = inputNum[1]
	answer = 0
	numInt = abs(x - y)
	if numInt == 0:
		answer = 0
	elif numInt <= 10:
		answer = 1
	elif numInt % 10 == 0:
		answer = int(numInt / 10)
	else:
		answer = int(numInt / 10) + 1
	return answer
num = int(input())
noOfways = 0
for i in range(num):
	a = []
	a = list(map(int, input().strip().split()))[:2]
	noOfways = findways(a)
	print(noOfways)


t = int(input())
while t:
	(a, b) = list(map(int, input().split()))
	if a > b:
		(a, b) = (b, a)
	count = b // 10 - a // 10
	temp = a + 10 * count
	if temp >= b:
		print(count)
	else:
		print(count + 1)
	t -= 1


import math
t = int(input(''))
for i in range(t):
	(a, b) = map(int, input('').split())
	if a == b:
		print(0)
	elif a > b:
		rem = (a - b) / 10
		ans = math.ceil(rem)
		print(ans)
	else:
		rem1 = (b - a) / 10
		ans1 = math.ceil(rem1)
		print(ans1)


def inp():
	return int(input())

def inl():
	return [int(i) for i in input().split()]
t = inp()
for _ in range(t):
	(a, b) = inl()
	d = abs(b - a)
	if d % 10 == 0:
		print(d // 10)
	else:
		print(d // 10 + 1)


t = int(input())
l = []
while t != 0:
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	if abs(b - a) == 0:
		print(0)
	elif abs(b - a) % 10 == 0:
		print(abs(b - a) // 10)
	else:
		print(abs(b - a) // 10 + 1)
	t -= 1


n = int(input())
list_ans = []
for i in range(n):
	(a, b) = map(int, input().split())
	c = abs(a - b)
	ans = (c - 1) // 10 + 1
	list_ans.append(ans)
for item in list_ans:
	print(item)


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
		continue
	if a > b:
		num = (a - b) // 10
		if (a - b) % 10 == 0:
			print(num)
		else:
			print(num + 1)
		continue
	else:
		num = (b - a) // 10
		if (b - a) % 10 == 0:
			print(num)
		else:
			print(num + 1)
		continue


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	r = abs(a - b)
	k = 0
	r = list(str(r))
	for j in range(len(r) - 1):
		k += int(r[j]) * 10 ** (len(r) - j - 2)
	if r[len(r) - 1] != '0':
		print(k + 1)
	else:
		print(k)


t = int(input())
s = []
for i in range(t):
	(a, b) = map(int, input().split(' '))
	diff = a - b
	s.append(abs(diff))
for i in range(t):
	k = s[i]
	if k == 0:
		print(0)
	else:
		c = 0
		if k >= 10:
			val = k // 10
			if k % 10 == 0:
				c = c + val
			else:
				c = c + val + 1
		else:
			c = 1
		print(c)


from sys import stdin

def inp():
	return stdin.buffer.readline().rstrip().decode('utf8')

def itg():
	return int(stdin.buffer.readline())

def mpint():
	return map(int, stdin.buffer.readline().split())
for __ in range(itg()):
	(a, b) = mpint()
	(q, r) = divmod(abs(a - b), 10)
	print(q if r == 0 else q + 1)


from math import ceil
t = int(input())
for _ in range(t):
	(a, b) = (int(i) for i in input().split(' '))
	res = ceil(abs(b - a) / 10)
	print(res)


import math
for i in range(int(input())):
	(a, b) = map(int, input().split())
	c = max(a, b)
	d = min(a, b)
	f = c - d
	print(math.ceil(f / 10))


def integer(a, b):
	if a == b:
		return 0
	if a > b:
		temp = a - b
	else:
		temp = b - a
	one = temp % 10
	two = temp // 10
	if one == 0:
		return two
	else:
		return two + 1
t = int(input())
for i in range(t):
	arr = list(map(int, input().strip().split()))
	print(integer(arr[0], arr[1]))


t = int(input())

def fun(a, b):
	diff = abs(b - a)
	if diff <= 10:
		if diff == 0:
			return 0
		else:
			return 1
	elif diff % 10 == 0:
		return diff // 10
	else:
		return diff // 10 + 1
for i in range(t):
	(a, b) = list(map(int, input().split()))
	print(fun(a, b))


import math
test = int(input())
while test > 0:
	test -= 1
	(a, b) = map(int, input().split())
	diff = abs(a - b)
	print(math.ceil(diff / 10))


t = int(input())
for test in range(t):
	(a, b) = [int(i) for i in input().split(' ')]
	if abs(a - b) % 10 == 0:
		result = abs(a - b) // 10
	else:
		result = abs(a - b) // 10 + 1
	print(result)


def solve(x, k):
	if k > x:
		ans = (k - x) // 10
		if (k - x) % 10 == 0:
			return ans
		else:
			return ans + 1
	elif x == k:
		return 0
	else:
		ans = (x - k) // 10
		if (x - k) % 10 == 0:
			return ans
		else:
			return ans + 1
t = int(input())
for _ in range(t):
	(x, k) = map(int, input().split())
	print(solve(x, k))


import math
t = int(input())
for i in range(t):
	ab = list(map(int, input().split()))
	diff = abs(ab[0] - ab[1])
	f = math.ceil(diff / 10)
	print(f)


t = int(input())
for i in range(t):
	import math
	n = list(map(int, input().split()))
	a = n[0]
	b = n[1]
	if a > b:
		y = (a - b) / 10
		x = math.ceil(y)
		print(x)
	else:
		k = (b - a) / 10
		l = math.ceil(k)
		print(l)


t = int(input())
for j in range(t):
	(a, b) = map(int, input().strip().split())
	c = 0
	dif = abs(a - b)
	c = int(dif // 10)
	rem = dif % 10
	if rem:
		print(c + 1)
	else:
		print(c)


def main():
	t = int(input())
	while t > 0:
		t -= 1
		(a, b) = [int(i) for i in input().split(' ')]
		if a == b:
			print(0)
			continue
		diff = abs(a - b)
		rez = diff // 10
		if diff % 10 > 0:
			rez += 1
		print(rez)
main()


for _ in range(int(input())):
	(a, b) = [int(x) for x in input().split()]
	(ans, rest) = divmod(abs(a - b), 10)
	ans += rest > 0
	print(ans)


def solve():
	(a, b) = map(int, input().split(' '))
	if a == b:
		return 0
	diff = abs(a - b)
	if diff % 10 == 0:
		return int(diff / 10)
	steps = int((diff + (10 - diff % 10)) / 10)
	return steps
tc = int(input())
for _ in range(tc):
	print(solve())


t = int(input())
for i in range(t):
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	d = abs(a - b)
	m = 0
	if d == 0:
		print('0')
	elif d > 10:
		div = int(d / 10)
		m = m + div
		n = int(d % 10)
		if n == 0:
			print(m)
		elif n <= 10:
			print(m + 1)
	elif d <= 10:
		print('1')


import math

def map_split(function):
	return list(map(function, input().split()))
for _ in range(int(input())):
	(a, b) = map_split(int)
	print(math.ceil(abs(a - b) / 10))


def process():
	(a, b) = list(map(int, input().split()))
	if a <= b:
		moves = (b - a) // 10
		if (b - a) % 10 != 0:
			return moves + 1
		return moves
	else:
		moves = (a - b) // 10
		if (a - b) % 10 != 0:
			return moves + 1
		return moves
tests = int(input())
for i in range(tests):
	print(process())


n = int(input())
l = [i for i in range(1, 11)][::-1]
for i in range(n):
	count = 0
	(a, b) = map(int, input().split())
	if a == b:
		print('0')
	elif a < b:
		b = b - a
		for i in l:
			if b >= i:
				q = b // i
				count += q
				b = b % i
				if b == 0:
					print(count)
					break
	elif a > b:
		a = a - b
		for i in l:
			if a >= i:
				q = a // i
				count += q
				a = a % i
				if a == 0:
					print(count)
					break


import math

def run():
	output = []
	for i in range(int(input())):
		a = input().split()
		b = int(a[0])
		c = int(a[1])
		output.append(str(math.ceil(abs(b - c) / 10)))
	print('\n'.join(output))
run()


testcase = int(input())
for test in range(testcase):
	(a, b) = map(int, input().split())
	if a == b:
		res = 0
	elif a > b:
		dif = a - b
		res = dif // 10
		if dif % 10 != 0:
			res += 1
	else:
		dif = b - a
		res = dif // 10
		if dif % 10 != 0:
			res += 1
	print(res)


import sys, math
for i in range(0, int(sys.stdin.readline())):
	ab = sys.stdin.readline().split()
	d = abs(int(ab[1]) - int(ab[0]))
	sys.stdout.write(str(math.ceil(d / 10)))
	sys.stdout.write('\n')


for case in range(int(input())):
	(a, b) = [int(x) for x in input().split()]
	d = abs(a - b)
	ans = 0
	for x in range(10, 0, -1):
		k = d // x
		ans += k
		if k > 0:
			d %= x
	print(ans)


from math import floor

def solve():
	(a, b) = map(int, input().split())
	k = abs(a - b) / 10
	if abs(a - b) % 10 != 0:
		print(floor(k) + 1)
	else:
		print(floor(k))
t = int(input())
for _ in range(t):
	solve()


import math

def get_ans(a, b):
	(a, b) = (min(a, b), max(a, b))
	diff = b - a
	return int(math.ceil(diff / 10))
t = int(input())
for i in range(t):
	(a, b) = list(map(int, input().split()))
	print(get_ans(a, b))


t = int(input())
for i in range(t):
	(m, n) = map(int, input().split())
	x = abs(m - n)
	c = 0
	while x > 10:
		c += x // 10
		x = x % 10
	if x == 0:
		print(c)
	else:
		c += 1
		print(c)


import math
t = int(input())
for l in range(t):
	(a, b) = list(map(int, input().split(' ')))
	count = 0
	d = abs(a - b)
	if d == 0:
		count = 0
	else:
		count = math.ceil(d / 10)
	print(count)


def getIntegers(a, b):
	val = abs(a - b)
	d = val // 10
	r = val % 10
	if r != 0:
		d += 1
	return d
t = int(input())
for i in range(t):
	(a, b) = tuple(map(int, input().split()))
	print(getIntegers(a, b))


N = int(input())
for n in range(N):
	(a, b) = list(map(int, input().split()))
	d = abs(a - b)
	print((d + 9) // 10)


import math
for _ in range(int(input())):
	ab = input()
	ab = ab.split()
	(a, b) = (int(ab[0]), int(ab[1]))
	if a > b:
		d = a - b
	elif b > a:
		d = b - a
	else:
		d = 0
	m = d / 10
	print(math.ceil(m))


def f():
	t = int(input())
	arr = []
	for _ in range(t):
		arr.append(list(map(int, input().split())))
	for (a, b) in arr:
		print((abs(a - b) + 9) // 10)
f()


def main(a, b):
	if a == b:
		return 0
	diff = abs(a - b)
	r = diff % 10
	d = int(diff / 10)
	if r == 0:
		return d
	else:
		return d + 1
t = int(input())
for t_itr in range(t):
	ab = list(map(int, input().rstrip().split()))
	a = ab[0]
	b = ab[1]
	res = main(a, b)
	print(res)


import sys

def task():
	(a, b) = map(int, input().split())
	if a > b:
		(a, b) = (b, a)
	return int((b - a + 9) / 10)
n = int(input())
for i in range(n):
	print(task())


totalInp = int(input())
for i in range(totalInp):
	inp = input().split(' ')
	inp[0] = int(inp[0])
	inp[1] = int(inp[1])
	if inp[1] > inp[0]:
		(inp[0], inp[1]) = (inp[1], inp[0])
	diff = inp[0] - inp[1]
	co = 0
	no = 10
	while diff > 0:
		copyDiff = diff // no
		co += copyDiff
		diff = diff - copyDiff * no
		no -= 1
	print(co)


n = int(input())
for _ in range(n):
	(a, b) = map(int, input().split())
	steps = abs(b - a)
	if steps % 10 != 0:
		print(steps // 10 + 1)
	else:
		print(steps // 10)


import math

def find_min(a, b):
	if a == b:
		return 0
	elif a > b:
		return math.ceil((a - b) / 10)
	elif a < b:
		return math.ceil((b - a) / 10)
k = int(input())
for i in range(k):
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	print(find_min(a, b))


t = int(input())
for case in range(t):
	(m, n) = [int(x) for x in input().split()]
	k = abs(m - n)
	print(-(-k // 10))


from sys import stdin, stdout
input = stdin.readline
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	x = abs(b - a)
	ans = 0
	k = 10
	while x > 1:
		ans += x // k
		x %= k
		k -= 1
	stdout.write(str(ans + x) + '\n')


test_cases = int(input())
for i in range(test_cases):
	(num1, num2) = map(int, input().split())
	diff = abs(num1 - num2)
	if diff % 10 == 0:
		print(diff // 10)
	else:
		print(diff // 10 + 1)


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	print((b - a) // 10 + bool((b - a) % 10) if a < b else (a - b) // 10 + bool((a - b) % 10))


from math import ceil
t = int(input())
for _ in range(t):
	(a, b) = map(int, input().strip().split())
	if a > b:
		(a, b) = (b, a)
	print(ceil((b - a) / 10))


import math
t = int(input())

def func(a, b):
	return math.ceil(abs(b - a) / 10)
for i in range(t):
	(a, b) = map(int, input().split())
	print(func(a, b))


n = int(input())
for x in range(n):
	A = list(map(int, input().split()))
	(a, b) = (A[0], A[1])
	if b < a:
		(a, b) = (b, a)
	if a == b:
		print(0)
	if b > a:
		if (b - a) % 10 == 0:
			print((b - a) // 10)
		else:
			print((b - a) // 10 + 1)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	count = 0
	k = abs(b - a)
	if a == b:
		print(count)
	elif a < b:
		if k % 10 != 0:
			count += 1
			k -= k % 10
			count += k / 10
		elif k % 10 == 0:
			count += k / 10
		print(int(count))
	elif a > b:
		if k % 10 != 0:
			count += 1
			k -= k % 10
			count += k / 10
		elif k % 10 == 0:
			count += k / 10
		print(int(count))


n = int(input())
for i in range(n):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	elif a < b:
		diff = b - a
		ans = diff // 10
		if ans == diff / 10:
			count = ans
		else:
			count = ans + 1
		print(count)
	else:
		diff = a - b
		ans = diff // 10
		if ans == diff / 10:
			count = ans
		else:
			count = ans + 1
		print(count)


import math
n_test = int(input())
while n_test:
	(a, b) = input().split()
	a = float(a)
	b = float(b)
	print(math.ceil(abs(a - b) / 10.0))
	n_test -= 1


for t in range(int(input())):
	(a, b) = map(int, input().split())
	diff = abs(a - b)
	print((diff - 1) // 10 + 1)


from math import ceil
t = int(input())
for _ in range(t):
	(a, b) = [int(p) for p in input().split()]
	diff = abs(a - b)
	count = diff // 10
	if diff % 10 == 0:
		print(count)
	else:
		print(count + 1)


def fact(x):
	if x == 0:
		return 1
	else:
		return x * fact(x - 1)

def lower_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] >= num:
			answer = middle
			end = middle - 1
		else:
			start = middle + 1
	return answer

def upper_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] <= num:
			answer = middle
			start = middle + 1
		else:
			end = middle - 1
	return answer

def abs(x):
	return x if x >= 0 else -x

def binary_search(li, val, lb, ub):
	ans = 0
	while lb <= ub:
		mid = (lb + ub) // 2
		if li[mid] > val:
			ub = mid - 1
		elif val > li[mid]:
			lb = mid + 1
		else:
			ans = 1
			break
	return ans

def kadane(x):
	sum_so_far = 0
	current_sum = 0
	for i in x:
		current_sum += i
		if current_sum < 0:
			current_sum = 0
		else:
			sum_so_far = mpos(sum_so_far, current_sum)
	return sum_so_far

def pref(li):
	pref_sum = [0]
	for i in li:
		pref_sum.append(pref_sum[-1] + i)
	return pref_sum

def graph(n, m):
	adj = dict()
	for i in range(1, n + 1):
		adj.setdefault(i, 0)
	for i in range(m):
		(a, b) = map(int, input().split())
		adj[a] += 1
		adj[b] += 1
	return adj
import sys
import threading
from math import *
sys.setrecursionlimit(300000)
threading.stack_size(10 ** 8)
po = int(log(10 ** 18)) + 2
li = []
for i in range(po):
	li.append(3 ** i)
li = li[::-1]
s = sum(li)
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	s = abs(a - b)
	print(int(ceil(s / 10)))


import sys
ll = lambda : list(map(int, input().split()))
lls = lambda : list(map(str, input().split()))
fin = lambda : list(map(float, input().split()))
st = lambda : input()
v = lambda : map(int, input().split())
ii = lambda : int(input())
mod = 10 ** 9 + 7
from math import *
from datetime import datetime
from collections import *
import math
for _ in range(ii()):
	(x, y) = v()
	d = abs(x - y)
	print(math.ceil(d / 10))


import sys
import math
t = int(input())
for j in range(t):
	(a, b) = map(int, input().split())
	diff = abs(b - a)
	if diff == 0:
		print(0)
		continue
	ans = int(math.ceil(diff / 10))
	print(ans)


T = int(input())
for t in range(T):
	(a, b) = list(map(int, input().split()))
	count = abs(a - b) // 10 + bool(abs(a - b) % 10) * 1
	print(count)


def do():
	q = int(input())
	import math
	for _ in range(q):
		(a, b) = map(int, input().split())
		x = abs(a - b)
		print(math.ceil(x / 10))
do()


t = int(input())
while t > 0:
	t -= 1
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	else:
		if a > b:
			(a, b) = (b, a)
		rem = b - a
		if rem % 10 == 0:
			print(rem // 10)
		else:
			print(rem // 10 + 1)


import sys
r = sys.stdin.readline
t = int(r())
for _ in range(t):
	(a, b) = map(int, r().split())
	cnt = 0
	if a == b:
		print(0)
		continue
	else:
		print((abs(a - b) - 1) // 10 + 1)


t = int(input())
for i in range(t):
	(a, b) = input().split()
	(a, b) = (int(a), int(b))
	c = 0
	d = abs(a - b)
	if d // 10 and d % 10:
		print(d // 10 + 1)
	if d // 10 == 0 and a == b:
		print(0)
	if d // 10 == 0 and a != b:
		print(1)
	if d // 10 and (not d % 10):
		print(d // 10)


t = int(input())
for _ in range(t):
	(a, b) = [int(i) for i in input().split()]
	m = abs(b - a) // 10
	if not abs(b - a) % 10:
		print(m)
	else:
		print(m + 1)


T = int(input())
for _ in range(T):
	(a, b) = list(map(int, input().split()))
	x = abs(a - b)
	ct = 0
	k = x // 10
	m = x % 10
	if m != 0:
		ct += 1
	ct += k
	print(ct)


T = lambda : range(int(input()))
A = lambda : list(map(int, input().split()))
for _ in T():
	(a, b) = A()
	if a == b:
		print(0)
		continue
	x = abs(a - b)
	if x % 10 == 0:
		print(x // 10)
	else:
		print(x // 10 + 1)


import math
t = int(input())
for i in range(t):
	count = 0
	(a, b) = map(int, input().split())
	c = abs(a - b)
	if math.ceil(c / 10) == c // 10:
		print(c // 10)
	else:
		print(c // 10 + 1)


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	elif a < b:
		b -= a
		print((b + 9) // 10)
	else:
		a -= b
		print((a + 9) // 10)


import math
T = int(input())
for _ in range(T):
	(n1, n2) = map(int, input().split())
	print((abs(n1 - n2) + 9) // 10)


import math

def func(a, b):
	maxy = max(a, b)
	mini = min(a, b)
	c = math.ceil((maxy - mini) / 10)
	return c
n = int(input())
for _ in range(n):
	x = input()
	(a, b) = (int(x.split()[0]), int(x.split()[1]))
	k = func(a, b)
	print(k)


for i in range(0, int(input())):
	ab = input().split()
	print(int((abs(int(ab[0]) - int(ab[1])) + 9) / 10))


n = int(input())
for i in range(n):
	k = list(map(int, input().split()))
	s = abs(k[0] - k[1])
	if s % 10 == 0:
		print(s // 10)
	else:
		print(s // 10 + 1)


import sys
import os
import heapq
import math
try:
	path = './file/input.txt'
	if os.path.exists(path):
		sys.stdin = open(path, 'r')
except:
	pass
t = int(input())

def printd(value):
	pass

def case():
	arr = list(map(int, input().split(' ')))
	(a, b) = (arr[0], arr[1])
	c = a - b if a > b else b - a
	print(c // 10 + (1 if c % 10 > 0 else 0))
for _ in range(t):
	case()


for test in range(int(input())):
	(a, b) = map(int, input().strip().split(' '))
	count = 0
	if a == b:
		print(0)
	elif a > b:
		x = a - b
		while True:
			i = 10
			flag = 0
			while i > 0:
				if int(x / i) > 0:
					flag = int(x / i)
					x -= int(x / i) * i
					break
				i -= 1
			count += 1 * flag
			if x == 0:
				break
		print(count)
	else:
		x = b - a
		while True:
			i = 10
			flag = 0
			while i > 0:
				if int(x / i) > 0:
					flag = int(x / i)
					x -= int(x / i) * i
					break
				i -= 1
			count += 1 * flag
			if x == 0:
				break
		print(count)


T = int(input())
for __ in range(T):
	(a, b) = map(int, input().split())
	abd = abs(b - a)
	ans = abd // 10
	if abd % 10 != 0:
		ans += 1
	print(ans)


MOD = 1000000007
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
ls = lambda : list(input())
from collections import *
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	l = abs(a - b)
	if l % 10 == 0:
		print(l // 10)
	else:
		print(l // 10 + 1)


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	c = 0
	if a == b:
		print(0)
		continue
	if b < a:
		(a, b) = (b, a)
	d = (b - a) % 10
	if d > 0:
		c = 1
	a = a + d
	c += (b - a) // 10
	print(c)


t = int(input())
for _ in range(t):
	(a, b) = list(map(int, input().split()))
	l = [10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
	d = abs(a - b)
	c = d // 10
	if d % 10 != 0:
		c += 1
	print(c)


for _ in [0] * int(input()):
	a = list(map(int, input().split()))
	a.sort()
	print((a[1] - a[0]) // 10 if (a[1] - a[0]) % 10 == 0 else (a[1] - a[0]) // 10 + 1)


def main():
	t = int(input())
	while t > 0:
		(a, b) = map(int, input().split())
		diff = abs(a - b)
		cnt = diff // 10
		diff = diff % 10
		if diff > 0 and diff < 10:
			cnt = cnt + 1
		print(cnt)
		t -= 1
main()


from sys import stdin, stdout
import bisect
from bisect import bisect_left as bl
from bisect import bisect_right as br
import itertools
from collections import Counter
from math import sqrt
import collections
import math
import heapq
import re

def modinv(n, p):
	return pow(n, p - 2, p)

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())

def Divisors(n):
	l = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l

def most_frequent(list):
	return max(set(list), key=list.count)

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

def ncr(n, r, p):
	t = fact[n] * (ifact[r] * ifact[n - r] % p) % p
	return t

def Convert(string):
	li = list(string.split(''))
	return li

def SieveOfEratosthenes(n):
	global prime
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	f = []
	for p in range(2, n):
		if prime[p]:
			f.append(p)
	return f
prime = []
q = []

def dfs(n, d, v, c):
	global q
	v[n] = 1
	x = d[n]
	q.append(n)
	j = c
	for i in x:
		if i not in v:
			f = dfs(i, d, v, c + 1)
			j = max(j, f)
	return j

def main():
	for _ in range(inin()):
		(a, b) = map(int, input().split())
		temp = abs(a - b)
		if temp == 0:
			print(0)
		elif temp <= 10:
			print(1)
		elif temp % 10 != 0:
			print(int(str(temp)[:-1]) + 1)
		else:
			print(int(str(temp)[:-1]))
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


t = int(input())
while t != 0:
	(A, B) = input().split()
	a = int(A)
	b = int(B)
	x = abs(a - b)
	if x % 10 == 0:
		print(int(x / 10))
	else:
		print(int(x / 10) + 1)
	t = t - 1


from math import ceil
i = int(input())
lst = []
for j in range(i):
	p = input().split(' ')
	p = list(map(lambda x: int(x), p))
	r = abs(p[1] - p[0])
	lst.append(str(ceil(r / 10)))
print('\n'.join(lst))


from sys import stdin, stdout

def find(A, B):
	H = abs(B - A)
	return H // 10 + int(bool(H % 10))

def main():
	for _ in range(int(stdin.readline())):
		(A, B) = list(map(int, stdin.readline().split()))
		print(find(A, B))
main()


T = int(input())
for _ in range(T):
	(a, b) = list(map(int, input().split()))
	diff = abs(a - b)
	result = diff // 10 + (1 if diff % 10 > 0 else 0)
	print(result)


import sys

def input():
	return sys.stdin.readline()[:-1]

def getInt():
	return int(input())

def getIntIter():
	return map(int, input().split())

def getIntList():
	return list(getIntIter())
for _ in range(int(input())):
	(a, b) = getIntIter()
	diff = abs(a - b)
	diff += 9
	diff = diff // 10
	print(diff)


l = []
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	s = abs(a - b)
	n = s // 10
	if s % 10 == 0:
		l.append(n)
	else:
		l.append(n + 1)
for i in l:
	print(i)


import heapq as hq
from heapq import heappop, heappush
from collections import deque, defaultdict, Counter

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())

def subset_sum_count(arr, n, sum):
	dp = [[0 for _ in range(sum + 1)] for _ in range(n + 1)]
	for i in range(n + 1):
		for j in range(sum + 1):
			if j == 0:
				dp[i][j] = 1
			elif arr[i - 1] <= j:
				dp[i][j] = dp[i - 1][j - arr[i - 1]] + dp[i - 1][j]
			else:
				dp[i][j] = dp[i - 1][j]
	return dp[n][sum]

def prefix(a):
	pre = []
	pre.append(a[0])
	for i in range(1, len(a)):
		pre.append(pre[i - 1] + a[i])
	return pre

def binary_search(func, lo, hi, abs_prec=1e-07):
	while abs(hi - lo) > abs_prec:
		mi = lo + (hi - lo) / 2
		if func(mi):
			hi = mi
		else:
			lo = mi
	return (lo + hi) / 2

def ternary_search(func, lo, hi, abs_prec=1e-07):
	while abs(hi - lo) > abs_prec:
		lo_third = lo + (hi - lo) / 3
		hi_third = hi - (hi - lo) / 3
		if func(lo_third) < func(hi_third):
			lo = lo_third
		else:
			hi = hi_third
	return (lo + hi) / 2

def discrete_binary_search(func, lo, hi):
	while lo < hi:
		mi = lo + (hi - lo) // 2
		if func(mi):
			hi = mi
		else:
			lo = mi + 1
	return lo

def discrete_ternary_search(func, lo, hi):
	while lo <= hi:
		lo_third = lo + (hi - lo) // 3
		hi_third = lo + (hi - lo) // 3 + (1 if 0 < hi - lo < 3 else (hi - lo) // 3)
		if func(lo_third) < func(hi_third):
			lo = lo_third + 1
		else:
			hi = hi_third - 1
	return lo
	return -1

def right_rotate(a, s):
	return a[s:] + a[:s]

def dec_to_bin(x):
	return int(bin(x)[2:])

def str_to_integer_list(n):
	a = []
	for i in range(len(n)):
		a.append(int(n[i]))
	return a

def list_to_str(l):
	s = ''
	for i in l:
		s += str(i)
	return s

def dijkstra(s, N, E):
	visited = set()
	dist = {}
	for i in range(1, N + 1):
		dist[i] = 1 << 29
	queue = [(dist[i], i) for i in range(1, N + 1)]
	hq.heappush(queue, (0, s))
	dist[s] = 0
	while queue:
		(d, u) = hq.heappop(queue)
		if u in visited:
			continue
		for t in E[u]:
			(v, r) = t
			if dist[v] > d + r:
				dist[v] = d + r
				hq.heappush(queue, (dist[v], v))
		visited.add(u)
	return dist

def prime_sieve(n):
	flag = n % 6 == 2
	sieve = bytearray((n // 3 + flag >> 3) + 1)
	for i in range(1, int(n ** 0.5) // 3 + 1):
		if not sieve[i >> 3] >> (i & 7) & 1:
			k = 3 * i + 1 | 1
			for j in range(k * k // 3, n // 3 + flag, 2 * k):
				sieve[j >> 3] |= 1 << (j & 7)
			for j in range(k * (k - 2 * (i & 1) + 4) // 3, n // 3 + flag, 2 * k):
				sieve[j >> 3] |= 1 << (j & 7)
	return sieve

def prime_list(n):
	res = []
	if n > 1:
		res.append(2)
	if n > 2:
		res.append(3)
	if n > 4:
		sieve = prime_sieve(n + 1)
		res.extend((3 * i + 1 | 1 for i in range(1, (n + 1) // 3 + (n % 6 == 1)) if not sieve[i >> 3] >> (i & 7) & 1))
	return res

def dijkstra(n, graph, start):
	(dist, parents) = ([float('inf')] * n, [-1] * n)
	dist[start] = 0
	queue = [(0, start)]
	while queue:
		(path_len, v) = heappop(queue)
		if path_len == dist[v]:
			for (w, edge_len) in graph[v]:
				if edge_len + path_len < dist[w]:
					(dist[w], parents[w]) = (edge_len + path_len, v)
					heappush(queue, (edge_len + path_len, w))
	return (dist, parents)

def path(start, end, parent):
	path = [end]
	while path[-1] != start:
		path.append(parent[path[-1]])
	path.reverse()
	return path

def bfs(graph, start, goal):
	if start == goal:
		return [start]
	visited = {start}
	queue = deque([(start, [])])
	while queue:
		(current, path) = queue.popleft()
		visited.add(current)
		for neighbor in graph[current]:
			if neighbor == goal:
				return path + [current, neighbor]
			if neighbor in visited:
				continue
			queue.append((neighbor, path + [current]))
			visited.add(neighbor)
	return None
import os
import sys
from io import BytesIO, IOBase

def DecimalToBinary(n):

	def helper(n):
		if n == 0:
			return ''
		else:
			if n % 2 == 1:
				binaryDigit = '1'
			else:
				binaryDigit = '0'
			return helper(n // 2) + binaryDigit
	if n == 0:
		result = '0'
	else:
		result = helper(n)
	return result

def p(board):
	for i in range(8):
		s = ''
		for j in range(8):
			s += board[i][j]
		print(s)

def binaryToDecimal(n):
	return int(n, 2)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def solve(a, b):
	x = DecimalToBinary(a)
	y = DecimalToBinary(b)
	z = x + y
	l = y + x
	r = binaryToDecimal(z) - binaryToDecimal(l)
	return r

def mostFrequent(arr, n):
	arr.sort()
	max_count = 1
	res = arr[0]
	curr_count = 1
	for i in range(1, n):
		if arr[i] == arr[i - 1]:
			curr_count += 1
		else:
			if curr_count > max_count:
				max_count = curr_count
				res = arr[i - 1]
			curr_count = 1
	if curr_count > max_count:
		max_count = curr_count
		res = arr[n - 1]
	return res
from bisect import bisect_right, bisect_left

def lds(arr, n):
	lds = [0] * n
	max = 0
	for i in range(n):
		lds[i] = 1
	for i in range(1, n):
		for j in range(i):
			if arr[i] < arr[j] and lds[i] < lds[j] + 1:
				lds[i] = lds[j] + 1
	for i in range(n):
		if max < lds[i]:
			max = lds[i]
	return max
import math

def solve():
	for _ in range(inp()):
		(a, b) = invr()
		x = abs(b - a)
		if x % 10 == 0:
			print(x // 10)
		else:
			print(x // 10 + 1)
solve()


import math
n = int(input())
for x in range(n):
	i = list(map(float, input().split()))
	k = abs(i[0] - i[1])
	l = k / 10
	print(math.ceil(l))


test_case = int(input())
for i in range(test_case):
	values = list(map(int, input().split(' ')))
	if values[0] == values[1]:
		print(0)
	elif abs(values[1] - values[0]) < 11:
		print(1)
	else:
		a = abs(values[1] - values[0])
		if a % 10 == 0:
			print(a // 10)
		else:
			print(a // 10 + 1)


t = int(input())
for i in range(t):
	(a, b) = sorted(list(map(int, input().split())))
	moves = (b - a) // 10
	if (b - a) % 10 > 0:
		moves += 1
	print(moves)


from math import ceil

def map_input(type=1):
	if type == 1:
		return map(int, input().split())
	elif type == 2:
		return map(float, input().split())
	elif type == 3:
		return map(str, input().split())
	return None

def list_input(type=1):
	return list(map_input(type))

def give_excel_column_name(r: int):
	l = 1
	r -= 1
	ans: str = ''
	while 26 ** l <= r:
		r -= 26 ** l
		l += 1
	while l > 0:
		ans += chr(ord('A') + r // 26 ** (l - 1) % 26)
		l -= 1
	return ans

def give_excel_column_number(name: str):
	p = 1
	ans: int = 0
	for j in range(len(name)):
		ans = ans + p * (ord(name[j]) - ord('A') + 1)
		p = p * 26
	return ans

def sorted_indices(s):
	li = []
	for i in range(len(s)):
		li.append([s[i], i])
	li.sort()
	return [x[1] for x in li]

def floorSearch(arr, x, low=-1, high=-1):
	if low == -1:
		low = 0
	if high == -1:
		high == len(arr) - 1
	if low > high:
		return -1
	if x >= arr[high]:
		return high
	mid = int((low + high) / 2)
	if arr[mid] == x:
		return mid
	if mid > 0 and arr[mid - 1] <= x and (x < arr[mid]):
		return mid - 1
	if x < arr[mid]:
		return floorSearch(arr, low, mid - 1, x)
	return floorSearch(arr, mid + 1, high, x)

def find_index(arr, x):
	low = 0
	high = len(arr) - 1
	mid = 0
	while low <= high:
		mid = (high + low) // 2
		if arr[mid] < x:
			low = mid + 1
		elif arr[mid] > x:
			high = mid - 1
		else:
			return mid
	return -1

def floyd_warshell(g):
	n = len(g)
	d = g.copy()
	for k in range(n):
		for i in range(n):
			for j in range(n):
				d[i][j] = min(d[i][j], d[i][k] + d[k][j])
	return d

def int_input(type=1):
	if type == 1:
		return int(input())
	elif type == 2:
		return float(int(input()))

def range_input():
	return range(int_input())

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

def main():
	for _ in range_input():
		(a, b) = map_input()
		print(ceil(abs(a - b) / 10))
try:
	main()
except:
	pass


def equal(a, b):
	if a > b:
		diff = a - b
	else:
		diff = b - a
	count = 0
	while diff != 0:
		if diff > 10:
			count += diff // 10
			diff = diff % 10
		else:
			count += 1
			return count
	return count
t = int(input())
for i in range(0, t):
	inp = list(map(int, input().split()))
	a = inp[0]
	b = inp[1]
	ans = equal(a, b)
	print(ans)


import math
t = int(input())
for i in range(0, t):
	(a, b) = map(int, input().split())
	p = abs(a - b) / 10
	print(math.ceil(p))


import math
t = int(input())
for _ in range(t):
	(n, m) = map(int, input().split())
	if n > m:
		print(math.ceil((n - m) / 10))
	elif m > n:
		print(math.ceil((m - n) / 10))
	else:
		print('0')


for _ in range(int(input())):
	(a, b) = list(map(int, input().split()))
	d = abs(a - b)
	x = d / 10
	if x > d // 10:
		print(int(x + 1))
	else:
		print(int(x))


import io, os, math
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
rr = lambda : input()
rri = lambda : int(input())
rrm = lambda : list(map(int, input().split()))
INF = float('inf')

def solve(A, B):
	diff = abs(B - A)
	return diff // 10 + +(diff % 10 != 0)
t = rri()
for _ in range(t):
	(a, b) = rrm()
	print(solve(a, b))


import sys
MOD = 10 ** 9 + 7
INF = 10 ** 9
PI = 3.141592653589793

def read_str():
	return sys.stdin.readline().strip()

def read_int():
	return int(sys.stdin.readline().strip())

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

def read_ints2(x):
	return map(lambda num: int(num) - x, sys.stdin.readline().strip().split())

def read_str_list():
	return list(sys.stdin.readline().strip().split())

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

def GCD(a: int, b: int) -> int:
	return b if a % b == 0 else GCD(b, a % b)

def LCM(a: int, b: int) -> int:
	return a * b // GCD(a, b)

def Main():
	for _ in range(read_int()):
		(a, b) = read_ints()
		ans = 0
		tmp = abs(a - b)
		ans += tmp // 10
		if tmp % 10:
			ans += 1
		print(ans)
Main()


T = int(input())
for i in range(T):
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	diferencia = ((a - b) ** 2) ** (1 / 2)
	k = diferencia // 10
	if diferencia - diferencia // 10 * 10 > 0:
		k += 1
	print(int(k))


t = int(input())
while t:
	a = input().split()
	ans = 0
	d = abs(int(a[0]) - int(a[1]))
	ans = d // 10
	if d % 10 != 0:
		ans += 1
	print(ans)
	t -= 1


for i in range(int(input())):
	(x, y) = [int(j) for j in input().split(' ')]
	print((abs(y - x) + 9) // 10)


from math import ceil
for _ in range(int(input())):
	nos = map(int, input().split())
	(a, b) = nos
	if a == b:
		print('0')
	else:
		if a > b:
			subs = a - b
			quotient = ceil(subs / 10)
		else:
			subs = b - a
			quotient = ceil(subs / 10)
		print(quotient)


try:
	from math import ceil
	for _ in range(int(input())):
		(a, b) = map(int, input().split())
		print(ceil(abs(a - b) / 10))
except:
	pass


import math

def main():
	(a, b) = map(int, input().strip().split())
	count = int(math.ceil(abs(a - b) / 10))
	print(count)
for _ in range(int(input())):
	main()


n = int(input())
counter = 0
ans = []
while counter < n:
	p = input().split(' ')
	(a, b) = (int(p[0]), int(p[1]))
	x = abs(b - a)
	if x % 10 == 0:
		s = x / 10
	else:
		s = x // 10 + 1
	ans.append(s)
	counter += 1
for x in ans:
	print(int(x))


import math
n = int(input())
for i in range(n):
	count = 0
	(a, b) = map(int, input().split())
	if a < b:
		diff = b - a
	else:
		diff = a - b
	print(math.ceil(diff / 10))


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	m = abs(a - b)
	d = m // 10
	if 10 * d != m:
		print(d + 1)
	else:
		print(d)


from __future__ import division, print_function
from sys import stdin, stdout
import bisect
import math
import heapq
i_m = 9223372036854775807

def inin():
	return int(input())

def stin():
	return input()

def spin():
	return map(int, stin().split())

def lin():
	return list(map(int, stin().split()))

def matrix(n):
	return [list(map(int, input().split())) for i in range(n)]

def string2intlist(s):
	return list(map(int, s))

def calculate_sum(a, N):
	m = N / a
	sum = m * (m + 1) / 2
	ans = a * sum
	return ans

def series(N):
	return N * (N + 1) // 2

def count2Dmatrix(i, list):
	return sum((c.count(i) for c in list))

def modinv(n, p):
	return pow(n, p - 2, p)

def GCD(x, y):
	x = abs(x)
	y = abs(y)
	if min(x, y) == 0:
		return max(x, y)
	while y:
		(x, y) = (y, x % y)
	return x

def LCM(x, y):
	return x * y // GCD(x, y)

def Divisors(n):
	l = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l

def isprime(n):
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			return False
	return True
prime = []

def SieveOfEratosthenes(n):
	global prime
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	f = []
	for p in range(2, n):
		if prime[p]:
			f.append(p)
	return f
q = []

def dfs(n, d, v, c):
	global q
	v[n] = 1
	x = d[n]
	q.append(n)
	j = c
	for i in x:
		if i not in v:
			f = dfs(i, d, v, c + 1)
			j = max(j, f)
	return j
for _ in range(inin()):
	(a, b) = spin()
	if a % 10 == b % 10:
		print(abs(a - b) // 10)
	else:
		print(abs(a - b) // 10 + 1)


import math
n = int(input())
arr = [list(map(int, input().split(' '))) for _ in range(n)]
for item in arr:
	dif = max(item) - min(item)
	s = dif / 10
	print(math.ceil(s))


t = int(input())
for you in range(t):
	l = input().split()
	a = int(l[0])
	b = int(l[1])
	z = abs(a - b)
	print((z + 9) // 10)


t = int(input())
for _ in range(t):
	(a, b) = [int(x) for x in input().split()]
	h = max(a, b)
	l = min(a, b)
	ans = (h - l) // 10
	if (h - l) % 10 != 0:
		ans += 1
	print(ans)


def nabor(a, b):
	razn = abs(a - b)
	if razn % 10 == 0:
		return razn // 10
	else:
		return razn // 10 + 1
myList = []
t = int(input())
for i in range(t):
	myList.append(list(map(int, input().split())))
for i in range(t):
	print(nabor(myList[i][0], myList[i][1]))


z = int(input())
d = []
for i in range(z):
	x = list(map(int, input().split()))
	c = 0
	a = x[0]
	b = x[1]
	while a != b:
		if b > a:
			s = (b - a) // 10
			a += s * 10
			c += s
			s = (b - a) // 9
			a += s * 9
			c += s
			s = (b - a) // 8
			a += s * 8
			c += s
			s = (b - a) // 7
			a += s * 7
			c += s
			s = (b - a) // 6
			a += s * 6
			c += s
			s = (b - a) // 5
			a += s * 5
			c += s
			s = (b - a) // 4
			a += s * 4
			c += s
			s = (b - a) // 3
			a += s * 3
			c += s
			s = (b - a) // 2
			a += s * 2
			c += s
			s = (b - a) // 1
			a += s
			c += s
		else:
			s = (a - b) // 10
			a -= s * 10
			c += s
			s = (a - b) // 9
			a -= s * 9
			c += s
			s = (a - b) // 8
			a -= s * 8
			c += s
			s = (a - b) // 7
			a -= s * 7
			c += s
			s = (a - b) // 6
			a -= s * 6
			c += s
			s = (a - b) // 5
			a -= s * 5
			c += s
			s = (a - b) // 4
			a -= s * 4
			c += s
			s = (a - b) // 3
			a -= s * 3
			c += s
			s = (a - b) // 2
			a -= s * 2
			c += s
			s = (a - b) // 1
			a -= s
			c += s
	d.append(c)
for i in d:
	print(i)


def sol(n, m):
	x = max(n, m)
	y = min(n, m)
	p = x - y
	if p % 10 == 0:
		print(p // 10)
	else:
		print(p // 10 + 1)
k = int(input())
for i in range(k):
	(n, m) = list(map(int, input().split(' ')))
	sol(n, m)


n = int(input())
for i in range(n):
	l = [int(x) for x in input().split()]
	print(int((abs(l[0] - l[1]) + 9) / 10))


import math

def doit(a):
	print(math.ceil(min(abs(a[1] - a[0]), abs(a[0] - a[1])) / 10))
for i in range(int(input())):
	doit(list(map(int, input().split())))


import math
for _ in range(int(input())):
	(a, b) = [int(x) for x in input().split()]
	diff = abs(a - b)
	moves = diff / 10
	print(math.ceil(moves))


n = int(input())
i = 0
result = list()
final = list()
while i < n:
	a_and_b = input().split()
	a = int(a_and_b[0])
	b = int(a_and_b[1])
	if a == b:
		result.append(0)
	elif b > a:
		result.append(b - a)
	else:
		result.append(b - a)
	i += 1
for j in result:
	if j < 0:
		r = 0
		rest = -1 * j
		if j * -1 > 0:
			if j * -1 >= 10:
				w = j * -1 // 10
				rest = j * -1 - w * 10
				r += w
				if rest == 0:
					final.append(r)
			if rest >= 9:
				w = rest // 9
				rest = rest - w * 9
				r += w
				if rest == 0:
					final.append(r)
			if rest >= 8:
				w = rest // 8
				rest = rest - w * 8
				r += w
				if rest == 0:
					final.append(r)
			if rest >= 7:
				w = rest // 7
				r += w
				rest = rest - w * 7
				if rest == 0:
					final.append(r)
			if rest >= 6:
				w = rest // 6
				r += w
				rest = rest - w * 6
				if rest == 0:
					final.append(r)
			if rest >= 5:
				w = rest // 5
				r += w
				rest = rest - w * 5
				if rest == 0:
					final.append(r)
			if rest >= 4:
				w = rest // 4
				r += w
				rest = rest - w * 4
				if rest == 0:
					final.append(r)
			if rest >= 3:
				w = rest // 3
				r += w
				rest = rest - w * 3
				if rest == 0:
					final.append(r)
			if rest >= 2:
				w = rest // 2
				r += w
				rest = rest - w * 2
				if rest == 0:
					final.append(r)
			if rest == 1:
				r += 1
				rest -= 1
				if rest == 0:
					final.append(r)
	elif j == 0:
		final.append(0)
	elif j > 0:
		r = 0
		rest = j
		if j > 0:
			if j >= 10:
				w = j // 10
				rest = j - w * 10
				r += w
				if rest == 0:
					final.append(r)
			if rest >= 9:
				w = rest // 9
				rest = rest - w * 9
				r += w
				if rest == 0:
					final.append(r)
			if rest >= 8:
				w = rest // 8
				rest = rest - w * 8
				r += w
				if rest == 0:
					final.append(r)
			if rest >= 7:
				w = rest // 7
				r += w
				rest = rest - w * 7
				if rest == 0:
					final.append(r)
			if rest >= 6:
				w = rest // 6
				r += w
				rest = rest - w * 6
				if rest == 0:
					final.append(r)
			if rest >= 5:
				w = rest // 5
				r += w
				rest = rest - w * 5
				if rest == 0:
					final.append(r)
			if rest >= 4:
				w = rest // 4
				r += w
				rest = rest - w * 4
				if rest == 0:
					final.append(r)
			if rest >= 3:
				w = rest // 3
				r += w
				rest = rest - w * 3
				if rest == 0:
					final.append(r)
			if rest >= 2:
				w = rest // 2
				r += w
				rest = rest - w * 2
				if rest == 0:
					final.append(r)
			if rest == 1:
				r += 1
				rest -= 1
				if rest == 0:
					final.append(r)
for e in final:
	print(e)


import math

def main():
	t = int(input())
	results = []
	for i in range(t):
		inp = input().split(' ')
		a = int(inp[0])
		b = int(inp[1])
		if a >= b:
			diff = a - b
		else:
			diff = b - a
		res = diff // 10
		if diff % 10 != 0:
			res += 1
		results.append(res)
	for res in results:
		print(res)
main()


T = int(input())
for i in range(T):
	inp = list(map(int, input().split()))
	a = inp[0]
	b = inp[1]
	if a == b:
		print(0)
	moves = 0
	if a > b:
		if (a - b) % 10 == 0:
			moves = (a - b) / 10
		else:
			moves = (a - b) // 10 + 1
		print(int(moves))
	if b > a:
		if (b - a) % 10 == 0:
			moves = (b - a) / 10
		else:
			moves = (b - a) // 10 + 1
		print(int(moves))


import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
ALPHA = 'abcdefghijklmnopqrstuvwxyz'
M = 998244353
EPS = 1e-06

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
for _ in range(Int()):
	(a, b) = value()
	need = abs(b - a)
	print(ceil(need / 10))


t = int(input())

def Yet(a, b):
	d = abs(a - b)
	if d % 10 != 0:
		return d // 10 + 1
	else:
		return d // 10
l = []
for i in range(t):
	(a, b) = map(int, input().split(' '))
	l.append(Yet(a, b))
for _ in l:
	print(_)


for i in range(int(input())):
	(z, x) = map(int, input().split())
	if z == x:
		print(0)
	else:
		s = abs(z - x)
		if s % 10 == 0:
			print(s // 10)
		else:
			print(s // 10 + 1)


import sys
import math
import collections
import bisect
import itertools
import decimal
import copy
INF = 10 ** 20
ni = lambda : int(sys.stdin.readline().rstrip())
ns = lambda : map(int, sys.stdin.readline().rstrip().split())
na = lambda : list(map(int, sys.stdin.readline().rstrip().split()))
na1 = lambda : list(map(lambda x: int(x) - 1, sys.stdin.readline().rstrip().split()))

def main():
	t = ni()
	for _ in range(t):
		(a, b) = ns()
		ans = abs(b - a) // 10
		tmp = 1 if abs(b - a) % 10 else 0
		print(ans + tmp)
main()


t = int(input())
for k in range(t):
	s = input()
	l = s.split()
	a = int(l[0])
	b = int(l[1])
	c = 0
	if a < b and b - a > 0:
		d = b - a
		c = d // 10
		if d % 10 != 0:
			c = c + 1
	if b < a and a - b > 0:
		d = a - b
		c = d // 10
		if d % 10 != 0:
			c = c + 1
	print(c)


from collections import defaultdict as dd, deque
from sys import stdin
input = stdin.readline
t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	ans = abs(a - b)
	ans1 = ans // 10
	ans2 = ans - ans // 10 * 10
	ans = ans // 10 + (ans - ans // 10 * 10) % 10
	if ans2:
		print(ans1 + 1)
	else:
		print(ans1)


for _ in range(int(input())):
	(a1, a2) = map(int, input().split())
	s = abs(a1 - a2)
	an = s // 10
	if s % 10 != 0:
		an = an + 1
	print(an)


def do(a, b):
	bigSteps = abs(b - a) // 10
	ad = a % 10
	bd = b % 10
	smallSteps = abs(ad - bd) // 10
	print(bigSteps + smallSteps + int(ad - bd != 0))
t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	do(a, b)


def move(a, b):
	moves = abs(a - b) // 10
	return moves if a % 10 == b % 10 else moves + 1
n = int(input())
for _ in range(n):
	(a, b) = list(map(int, input().split(' ')))
	print(move(a, b))


a = int(input())
h = []
for i in range(0, a):
	(x, y) = list(map(int, input().split()))
	g = abs(x - y)
	k = (g + 9) // 10
	h.append(k)
print(*h, sep='\n')


n = int(input())
for q in range(n):
	(a, b) = [int(x) for x in input().split()]
	t = abs(b - a)
	print(t // 10 + (t % 10 > 0))


import math
for cases in range(int(input())):
	(n, m) = map(int, input().split())
	print(math.ceil(abs(n - m) / 10))


import math
T = int(input())
while T:
	T -= 1
	(a, b) = [int(x) for x in input().split()]
	diff = abs(b - a)
	ans = math.ceil(diff / 10)
	print(ans)


def solve(a1, b1):
	ans = 0
	a = max(a1, b1)
	b = min(a1, b1)
	if (a - b) % 10 != 0:
		ans += 1
	print((a - b) // 10 + ans)
for i in range(int(input())):
	(a, b) = list(map(int, input().split()))
	solve(a, b)


import sys
input = sys.stdin.readline
t = int(input())
for tt in range(t):
	(a, b) = map(int, input().split())
	print((abs(a - b) + 9) // 10)


T = int(input())
for _ in range(T):
	(a, b) = [int(x) for x in input().split()]
	print((abs(b - a) + 9) // 10)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	j = abs(k - n) + 9
	print(j // 10)


for t in range(0, int(input())):
	(a, b) = map(int, input().strip().split())
	diff = abs(a - b)
	diff2 = diff / 10
	diff3 = diff // 10
	if diff2 - diff3 == 0:
		print(int(diff2))
	else:
		print(diff3 + 1)


import sys
input = sys.stdin.buffer.readline

def I():
	return list(map(int, input().split()))

def sieve(n):
	a = [1] * n
	for i in range(2, n):
		if a[i]:
			for j in range(i * i, n, i):
				a[j] = 0
	return a
for __ in range(int(input())):
	(a, b) = I()
	diff = abs(a - b)
	ans = diff // 10
	if diff % 10:
		ans += 1
	print(ans)


t = int(input())
while t > 0:
	x = list(map(int, input().split()))
	a = x[0]
	b = x[1]
	c = abs(a - b)
	d = int(c / 10)
	e = c % 10
	if e == 0:
		print(d)
	else:
		print(d + 1)
	t -= 1


t = int(input())
w = []
for i in range(t):
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	c = max(a, b) - min(a, b)
	d = c // 10
	if c % 10 == 0:
		k = d
	else:
		k = d + 1
	w.append(k)
for i in w:
	print(i)


for _ in range(int(input())):
	x = input().split()
	a = int(x[0])
	b = int(x[1])
	print(int((abs(a - b) + 9) / 10))


from sys import stdin, stdout
from collections import Counter, deque
import math
cin = stdin.readline
cout = stdout.write

def inpn():
	return int(cin())

def inpl():
	return list(map(int, cin().split()))

def inps():
	return cin()[:-1]

def inpv():
	return map(int, cin().split())

def outs(s):
	cout(s)

def outn(n):
	cout(str(n))

def outl(l):
	for i in l:
		cout(str(i) + ' ')

def outb(s):
	cout(str(s))
for _ in range(inpn()):
	(a, b) = inpv()
	x = abs(a - b)
	if x % 10 == 0:
		outn(x // 10)
		cout('\n')
	else:
		outn(x // 10 + 1)
		cout('\n')


t = int(input())
l1 = []
while t != 0:
	(a, b) = map(int, input().split())
	req = abs(b - a)
	if req > 0:
		rem = req % 10
		req = req // 10
		if rem > 0:
			print(req + 1)
		else:
			print(req)
	else:
		print(0)
	t -= 1


t = int(input())
for cas in range(t):
	(a, b) = map(int, input().split())
	if a > b:
		(a, b) = (b, a)
	ret = (b - a + 9) // 10
	print(ret)


import sys
input = sys.stdin.readline
T = int(input())
for _ in range(T):
	(a, b) = map(int, input().split())
	(a, b) = (min(a, b), max(a, b))
	v = (b - a) // 10
	if (b - a) % 10 != 0:
		v = v + 1
	print(v)


T = int(input())
for t in range(T):
	(a, b) = [int(s) for s in input().split()]
	Y = abs(b - a)
	ans = Y // 10 + (Y % 10 > 0)
	print(ans)


import math
t = int(input())
for _ in range(t):
	(a, b) = tuple([int(i) for i in input().split()])
	v = abs(b - a)
	print(math.ceil(v / 10))


import sys
si = sys.stdin.readline

def main():
	t = int(si())
	while t:
		t -= 1
		[a, b] = [int(e) for e in si().split()]
		temp = abs(a - b)
		q = temp // 10
		r = temp % 10
		if not r:
			print(q)
		else:
			print(q + 1)
main()


from collections import Counter
tst = int(input())
t = 1
while t <= tst:
	(a, b) = map(int, input().split())
	x = abs(a - b)
	i = 10
	mn = 100000000
	while i >= 10:
		p = int(x / i)
		q = x % i
		if q == 0:
			mn = min(p, mn)
		else:
			mn = min(p + 1, mn)
		i -= 1
	print(mn)
	t += 1


import sys, math, heapq, collections, itertools, bisect
sys.setrecursionlimit(101000)

def solve(a, b):
	diff = abs(a - b)
	(u, l) = divmod(diff, 10)
	return u + int(l > 0)
t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	print(solve(a, b))


t = int(input())
for i in range(t):
	k = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
	(a, b) = [int(i) for i in input().split()]
	c = 0
	if a == b:
		print(0)
	else:
		remain = abs(b - a)
		z = remain
		remain = remain // 10
		if z <= 10:
			print(1)
		elif z % 10 == 0:
			print(remain)
		else:
			print(remain + 1)


t = int(input())
arr = []
for i in range(t):
	(a, b) = map(int, input().split())
	temp = abs(a - b)
	if temp % 10 == 0:
		arr.append(str(temp // 10))
	else:
		arr.append(str(temp // 10 + 1))
print('\n'.join(arr))


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	(d, p) = divmod(abs(b - a), 10)
	print(d if p == 0 else d + 1)


n = int(input())
for i in range(n):
	(a, b) = sorted(map(int, input().split()))
	print((b - a - 1) // 10 + 1, end='\n')


n = int(input())
for __ in range(n):
	(a, b) = input().split()
	(a, b) = (int(a), int(b))
	if a == b:
		print(0)
		continue
	elif b < a:
		(a, b) = (b, a)
	difference = b - a
	moves = difference // 10
	if difference % 10:
		moves += 1
	print(moves)


import sys
t = int(sys.stdin.readline().strip())
for _ in range(t):
	(a, b) = map(int, sys.stdin.readline().strip().split())
	no = abs(b - a)
	m = no
	c = 10
	ans = 0
	while c >= 1 and m != 0:
		d = m // c
		m = m % c
		if d == 0:
			c -= 1
		ans += d
	print(ans)


tc = int(input())
for _ in range(tc):
	[a, b] = list(map(int, input().split()))
	if a > b:
		if (a - b) % 10 == 0:
			artir = 0
		else:
			artir = 1
		print((a - b) // 10 + artir)
	elif a < b:
		if (b - a) % 10 == 0:
			artir = 0
		else:
			artir = 1
		print((b - a) // 10 + artir)
	else:
		print(0)


for T in range(int(input())):
	(a, b) = map(int, input().split())
	diff = abs(a - b)
	c = diff // 10 + (diff % 10 != 0)
	print(c)


a = int(input())
for i in range(a):
	str = input()
	a = str.split(sep=' ')
	(a[0], a[1]) = (int(a[0]), int(a[1]))
	result = abs(a[0] - a[1]) // 10
	if abs(a[0] - a[1]) % 10 != 0:
		result += 1
	print(result)


import sys
import math
from collections import defaultdict, Counter
input = sys.stdin.readline

def print(x):
	sys.stdout.write(str(x) + '\n')
t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	ans = int(math.ceil(abs(a - b) / 10))
	print(ans)


n = int(input())
for _ in range(n):
	(a, b) = map(int, input().split())
	if a < b:
		(a, b) = (b, a)
	a = a - b
	sum = 1 if a % 10 else 0
	mn = 1
	while a != 0:
		a = a // 10
		b = a % 10
		sum += b * mn
		mn *= 10
	print(sum)


from collections import deque
import sys
input = sys.stdin.readline

def find(a, b):
	x = b - a
	if x < 0:
		x = -1 * x
	num1 = x // 10
	num2 = x % 10
	if num2 != 0:
		num1 += 1
	print(num1)
N = int(input())
for i in range(N):
	(a, b) = map(int, input().split())
	find(a, b)


def read_int():
	return int(input())

def read_ints():
	return map(int, input().split(' '))
t = read_int()
for case_num in range(t):
	(a, b) = read_ints()
	delta = abs(a - b)
	print(delta // 10 + (1 if delta % 10 != 0 else 0))


def solve():
	(a, b) = map(int, input().split())
	print(abs(a - b) // 10 + (abs(a - b) % 10 > 0))
for cnt in range(int(input())):
	solve()


n = int(input())
while n > 0:
	n -= 1
	(x, y) = map(int, input().split())
	temp = abs(x - y)
	if temp == 0:
		print('0')
		continue
	elif temp % 10 == 0:
		print(temp // 10)
	else:
		print(temp // 10 + 1)


for nt in range(int(input())):
	(a, b) = map(int, input().split())
	print((abs(b - a) - 1) // 10 + 1)


import sys
import math
import time
from functools import lru_cache
from collections import Counter
import heapq

def Update(X, AX, BX, CX, DX, k, n):
	for i in range(k, n):
		tem = (AX * X[i - 2] + BX * X[i - 1] + CX) % DX + 1
		X.append(tem)
try:
	for _ in range(int(input())):
		(n, k) = map(int, input().split())
		if n == k:
			print(0)
		else:
			d = abs(n - k)
			if d % 10 == 0:
				print(d // 10)
			else:
				print(d // 10 + 1)
except EOFError as e:
	print(e)


game = int(input())
for i in range(game):
	(a, b) = list(map(int, input().split()))
	if abs(a - b) % 10 == 0:
		print(int(abs(a - b) / 10))
	else:
		print(int(abs(a - b) / 10 + 1))


import sys
input = sys.stdin.readline
from math import ceil
t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	print(int(ceil(abs(a - b) / 10)))


def cf():
	s = input().split()
	new_s = []
	for i in s:
		i = int(i)
		new_s.append(i)
	dif = abs(new_s[0] - new_s[1])
	if dif / 10 == dif // 10:
		print(dif // 10)
	else:
		print(dif // 10 + 1)
n = int(input())
for i in range(n):
	cf()


import math
t = int(input())
for i in range(0, t):
	(x, y) = input().split()
	print(math.ceil(abs(float(x) - float(y)) / 10))


from sys import stdin, stdout

def gmi():
	return map(int, stdin.readline().strip().split())

def gms():
	return map(str, stdin.readline().strip().split())

def gari():
	return list(map(int, stdin.readline().strip().split()))

def gars():
	return list(map(str, stdin.readline().strip().split()))

def gs():
	return stdin.readline().strip()

def gls():
	return list(stdin.readline())

def gi():
	return int(stdin.readline().strip())
t = gi()
while t:
	t -= 1
	(a, b) = gmi()
	ans = 0
	if b == a:
		print(0)
	elif (b - a) % 10:
		print(int(abs(b - a) // 10) + 1)
	else:
		print(int(abs(b - a) // 10))


import math
t = int(input())
while t:
	(a, b) = map(int, input().split())
	if a > b:
		c = (a - b) / 10
		d = math.floor(c)
		if not math.floor(c) == math.ceil(c):
			print(d + 1)
		else:
			print(d)
	else:
		c = (b - a) / 10
		d = math.floor(c)
		if not math.floor(c) == math.ceil(c):
			print(d + 1)
		else:
			print(d)
	t = t - 1


import os
import sys
from io import BytesIO, IOBase
import math

def main():
	pass
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def binary(n):
	return bin(n).replace('0b', '')

def decimal(s):
	return int(s, 2)

def pow2(n):
	p = 0
	while n > 1:
		n //= 2
		p += 1
	return p

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(i)
			n = n / i
	if n > 2:
		l.append(int(n))
	return l

def isPrime(n):
	if n == 1:
		return False
	else:
		root = int(n ** 0.5)
		root += 1
		for i in range(2, root):
			if n % i == 0:
				return False
		return True

def maxPrimeFactors(n):
	maxPrime = -1
	while n % 2 == 0:
		maxPrime = 2
		n >>= 1
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			maxPrime = i
			n = n / i
	if n > 2:
		maxPrime = n
	return int(maxPrime)
for xyz in range(0, int(input())):
	(a, b) = map(int, input().split())
	n = abs(a - b)
	if n == 0:
		print(0)
	else:
		ans = n // 10
		if n % 10 != 0:
			print(ans + 1)
		else:
			print(ans)


t = int(input())
k = 10
KOLVO = []
for i in range(t):
	(a, b) = input().split()
	(a, b) = (int(a), int(b))
	n = 0
	if b > a:
		if b - k > a:
			n += (b - a) // k
			b = b - k * ((b - a) // k)
		if b > a:
			n += 1
	elif a > b:
		if a - k > b:
			n += (a - b) // k
			a = a - k * ((a - b) // k)
		if a > b:
			n += 1
	KOLVO.append(n)
for i in range(t):
	print(KOLVO[i])


import math
import re
import itertools
import copy
import time
import sys

def input_linear(lamb=lambda x: int(x), seperator=' '):
	return map(lamb, input().split(seperator))

def input_array(lamb=lambda x: int(x), seperator=' '):
	return list(map(lamb, input().split(seperator)))

def input_matrix(rows, lamb=lambda x: int(x), seperator=' '):
	tmp_matrix = []
	for i in range(rows):
		tmp_matrix.append(input_array(lamb, seperator))
	return tmp_matrix

def input_graph_al_pair(vertices, lines, lamb=lambda x: int(x), seperator=' ', directional=False, remove_dup=False):
	temp_matrix = [x[:] for x in [[]] * vertices]
	if not directional:
		if not remove_dup:
			for i in range(lines):
				(ina, inb) = input_linear(lamb, seperator)
				temp_matrix[ina].append(inb)
				temp_matrix[inb].append(ina)
		else:
			for i in range(lines):
				(ina, inb) = input_linear(lamb, seperator)
				if inb not in temp_matrix[ina]:
					temp_matrix[ina].append(inb)
				if ina not in temp_matrix[inb]:
					temp_matrix[inb].append(ina)
		return temp_matrix
	else:
		if not remove_dup:
			for i in range(lines):
				(ina, inb) = input_linear(lamb, seperator)
				temp_matrix[ina].append(inb)
		else:
			for i in range(lines):
				(ina, inb) = input_linear(lamb, seperator)
				if inb not in temp_matrix[ina]:
					temp_matrix[ina].append(inb)
		return temp_matrix
for _ in range(int(input())):
	(a, b) = input_linear()
	print(math.ceil(abs(b - a) / 10))


def main(i):
	a = i[0]
	b = i[1]
	diff = abs(a - b)
	if diff == 0:
		return 0
	elif diff % 10 == 0:
		return diff // 10
	else:
		return diff // 10 + 1
for _ in range(int(input())):
	print(main(list(map(int, input().split()))))


import math
t = int(input())
A = []
for i in range(t):
	n = list(map(int, input().split()))
	A.append(math.ceil(abs(n[0] - n[1]) / 10))
for i in A:
	print(i)


from math import *
t = int(input())
for cases in range(t):
	c = 0
	(a, b) = list(map(int, input().split()))
	if a == b:
		print('0')
	elif a < b:
		c = (b - a) / 10
		print(ceil(c))
	elif a > b:
		c = (a - b) / 10
		print(ceil(c))


t = int(input())
for i in range(t):
	ab = tuple(map(int, input().split()))
	ans = abs(ab[0] - ab[1]) / 10
	if ans.is_integer():
		print(int(ans))
	else:
		print(int(ans + 1))


import sys
import math

def II():
	return int(sys.stdin.readline())

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

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

def SI():
	return sys.stdin.readline().strip()
t = II()
for q in range(t):
	(a, b) = MI()
	print(math.ceil(abs(a - b) / 10))


t = int(input())
while t > 0:
	s = input()
	(a, b) = s.split(' ')
	a = int(a)
	b = int(b)
	diff = abs(a - b)
	if diff == 0:
		print(0)
	else:
		ans = diff // 10
		if diff % 10 != 0:
			ans += 1
		print(ans)
	t -= 1


a = int(input())
b = []
count = 0
for l in range(a):
	for i in input().split():
		b.append(int(i))
	dif = abs(b[0] - b[1])

	def cnt(dif):
		if dif % 10 != 0:
			dif -= dif % 10
			count = dif / 10 + 1
		else:
			count = dif / 10
		print(int(count))
	if b[0] == b[1]:
		print(0)
	else:
		cnt(dif)
	b.clear()


from math import ceil
t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	diff = abs(a - b)
	ans = diff / 10
	if diff % 10:
		ans += 1
	print(int(ans))


t = int(input())
for T in range(t):
	(a, b) = input().split()
	(a, b) = (int(a), int(b))
	(a_, b_) = (a // 10, b // 10)
	(_a, _b) = (a % 10, b % 10)
	if a > b:
		print(a_ - b_ + (0 if _b >= _a else 1))
	elif b > a:
		print(b_ - a_ + (0 if _a >= _b else 1))
	else:
		print(0)


t = int(input())
for k in range(t):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	else:
		v = abs(a - b)
		d = v // 10
		r = v % 10
		if r == 0:
			print(d)
		else:
			print(d + 1)


for _ in range(int(input())):
	(a, b) = (int(i) for i in input().split())
	abs_difference = abs(a - b)
	k = 0
	if abs_difference % 10 != 0:
		k = 1
	print(abs_difference // 10 + k)


testcases = int(input())
for i in range(testcases):
	(a, b) = input().split(' ')
	a = int(a)
	b = int(b)
	dif = abs(b - a)
	if dif % 10 == 0:
		print(int(dif / 10))
	else:
		val = int((dif - dif % 10) / 10) + 1
		print(val)


from math import ceil

def fun(a, b):
	i = max(a, b)
	j = min(a, b)
	c = i - j
	print(ceil(c / 10))
T = int(input())
for i in range(T):
	(a, b) = input().split()
	fun(int(a), int(b))


from sys import stdin
from math import ceil, gcd

def func():
	return
for _ in range(int(stdin.readline())):
	(a, b) = map(int, stdin.readline().split())
	if a < b:
		c = b - a
		if c % 10 == 0:
			print(c // 10)
		else:
			print(c // 10 + 1)
	elif a == b:
		print(0)
	else:
		c = a - b
		if c % 10 == 0:
			print(c // 10)
		else:
			print(c // 10 + 1)


from sys import stdin, stdout
import math
t = int(stdin.readline())
a = [0] * t
for i in range(0, t):
	a[i] = [int(x) for x in stdin.readline().split()]
	k = math.ceil(abs(a[i][0] - a[i][1]) / 10)
	print(str(k))


n = int(input())
for _ in range(n):
	(a, b) = map(int, input().split())
	d = abs(a - b)
	i = d // 10
	if d % 10 != 0:
		i += 1
	print(i)


t = int(input())
while t != 0:
	(x, y) = [int(k) for k in input().split()]
	diff = abs(x - y)
	count = 0
	count = int(diff / 10)
	if diff % 10 != 0:
		count += 1
	print(count)
	t -= 1


from math import gcd, ceil, log, floor
from collections import Counter, deque
from heapq import heappush, heappop, heapify

def rl():
	return list(map(int, input().split()))

def arp(arr):
	return ''.join(arr)
for _ in range(int(input())):
	(a, b) = rl()
	if a == b:
		print(0)
	else:
		print(ceil(abs(a - b) / 10))


import math as m
t = int(input())
for _ in range(t):
	(a, b) = [int(x) for x in input().split()]
	print(m.ceil(abs(b - a) / 10))


n = int(input())
while n > 0:
	n -= 1
	a = input().split(' ')
	b = int(a[1])
	a = int(a[0])
	if a > b:
		c = a - b
	else:
		c = b - a
	if c % 10 > 0:
		print(int(c // 10 + 1))
	else:
		print(int(c // 10))


def solve(test):
	(a, b) = map(int, input().split())
	if a > b:
		(a, b) = (b, a)
	ans = (b - a + 9) // 10
	print(ans)
t = int(input())
for _ in range(t):
	solve(_ + 1)


import sys
import math
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
(n,) = I()
while n:
	n -= 1
	(a, b) = I()
	if a == b:
		print(0)
	else:
		print(math.ceil(abs((a - b) / 10)))


def mine(a, b):
	cn = 0
	if a == b:
		pass
	elif abs(a - b) % 10 != 0:
		cn += abs(a - b) // 10 + 1
	else:
		cn += abs(a - b) // 10
	return cn
n = int(input())
val = []
for i in range(n):
	(a, b) = [int(j) for j in input().split(' ')]
	val.append(mine(a, b))
for i in range(n):
	print(val[i])


cases = eval(input())
moves = 0
dist = 0
resto = 0
answ = []
for e in range(cases):
	integ = input()
	integ = [int(i) for i in integ.split()]
	dist = abs(integ[0] - integ[1])
	if dist != 0:
		moves += dist // 10
	if dist % 10 > 0:
		moves += 1
	answ.append(moves)
	moves = 0
for e in answ:
	print(e)


for m in range(int(input())):
	ab = list(map(int, input().split()))
	mod = abs(ab[1] - ab[0])
	steps = 0
	for i in range(10, 0, -1):
		if mod == 0:
			break
		else:
			steps += mod // i
			mod -= mod // i * i
	print(steps)


def in1():
	return int(input())
for _ in range(in1()):
	(a, b) = map(int, input().split())
	if a == b:
		print(0)
	else:
		if a > b:
			(a, b) = (b, a)
		t1 = b - a
		i = 10
		while t1 // i == 0 and i > 0:
			i -= 1
		t2 = t1 // i
		if t1 % i != 0:
			print(t2 + 1)
		else:
			print(t2)


import atexit
import io
import sys
_INPUT_LINES = sys.stdin.read().splitlines()
input = iter(_INPUT_LINES).__next__
_OUTPUT_BUFFER = io.StringIO()
sys.stdout = _OUTPUT_BUFFER

@atexit.register
def write():
	sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
for case in range(int(input())):
	(a, b) = [int(x) for x in input().split()]
	diff = abs(b - a)
	ans = diff // 10 + int(bool(diff % 10))
	print(ans)


t = int(input())
for i in range(t):
	(a, b) = list(map(int, input().split()))
	c = max(a, b)
	d = min(a, b)
	if c - d == 0:
		print(0)
	elif c - d <= 10:
		print(1)
	else:
		ans = 0
		e = c - d
		if e % 10 == 0:
			ans = e // 10
		else:
			ans += e // 10 + 1
		print(ans)


n = int(input())
for i in range(n):
	c = 0
	(a, b) = map(int, input().split())
	k = abs(a - b)
	if k == 0:
		print(c)
	elif k < 10 and k != 0:
		c = 1
		print(c)
	else:
		d = k // 10
		c = c + d
		r = k % 10
		if r != 0:
			c = c + 1
		print(c)


import math

def print_result(ans):
	print(ans)

def solve(a, b):
	return math.ceil(abs(a - b) / 10)
t = int(input())
for i in range(1, t + 1):
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	ans = solve(a, b)
	print_result(ans)


import math

def function(a, b):
	if a == b:
		return 0
	if abs(a - b) <= 10:
		return 1
	if a < b:
		return math.ceil((b - a) / 10)
	if a > b:
		return math.ceil((a - b) / 10)
t = int(input())
for i in range(t):
	(a, b) = map(int, input().rstrip().split())
	print(function(a, b))


from math import *
from copy import *
from string import *
from random import *
from sys import stdin, stdout
from sys import maxsize
from operator import *
from itertools import *
from collections import Counter
import math
import math
import time
from queue import Queue

def seive(n):
	l = [True]
	l = l * (n + 1)
	for i in range(2, int(sqrt(n)) + 1):
		if l[i] == True:
			val = i * i
			while val < len(l):
				l[val] = False
				val += i
	prime = []
	for i in range(2, len(l)):
		if l[i] == True:
			prime.append(i)
	return prime

def dp(l, i, n, val, ans):
	if i >= n or val < 0:
		return 1000000
	elif val == 0:
		return 0
	else:
		if ans[i] == 1000000:
			ans[i] = min(min(1 + dp(l, i + 1, n, val - l[i], ans), 1 + dp(l, i, n, val - l[i], ans)), dp(l, i + 1, n, val, ans))
		return ans[i]
from queue import Queue

def factors(n):
	l = []
	for i in range(1, int(sqrt(n)) + 1):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l

def check1(s, v, x):
	while True:
		if v not in s:
			return v
		else:
			v -= 1

def check2(s, v, x):
	while True:
		if v not in s:
			return v
		else:
			v += 1

def up(n):
	j = n - 1
	while j > 0:
		if n % j == 0:
			break
		j -= 1
	return j

def fac(n):
	c = 1
	i = 1
	while i <= n:
		c *= i
		i += 1
	return c

def check_happy(n):
	ss = set()
	print(n)
	while n != 1:
		val = n
		s = 0
		print(val)
		while val != 0:
			s += (val % 10) ** 2
			val = val // 10
		print(val)
		print('hi')
		if val in ss:
			return False
		else:
			n = val
			ss.add(n)
	return True

def update(a, b):
	c = 1
	val = a
	while a < b:
		print(c, a)
		c += c
		a += a
	print(1)
	while a > b:
		print()
		a -= val
		c -= 1
	return c
import random as rand

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)
from itertools import permutations

def insertion_sort(arr):
	for i in range(len(arr)):
		j = i
		while j > 0:
			if arr[j] < arr[j - 1]:
				temp = arr[j]
				arr[j] = arr[j - 1]
				arr[j - 1] = temp
			j -= 1
	return arr

def quick_sort(arr, low, high):
	i = low
	j = high
	while i < j:
		if arr[i] > arr[low] and arr[j] < arr[low]:
			temp = arr[i]
			arr[i] = arr[j]
			arr[j] = arr[i]
			i += 1
			j -= 1
		elif arr[i] <= arr[low]:
			i += 1
		elif arr[j] >= arr[low]:
			j -= 1
	print(i, j)
	toto = arr[j]
	arr[j] = arr[low]
	arr[low] = toto
	return j

def dodo(arr, low, high):
	if low < high:
		val = quick_sort(arr, low, high)
		dodo(arr, low, val - 1)
		dodo(arr, val + 1, high)

def dp(arr, c, n, k, z, ans):
	if k == 0:
		return ans
	elif c == 0:
		return dp(arr, c + 1, n, k - 1, z, ans + arr[c + 1])
	elif c == n - 1:
		if z == 0:
			return 0
		else:
			return dp(arr, c - 1, n, k - 1, z - 1, ans + arr[c - 1])
	elif z == 0:
		return dp(arr, c + 1, n, k - 1, z, ans + arr[c + 1])
	else:
		return max(dp(arr, c + 1, n, k - 1, z, ans + arr[c + 1]), dp(arr, c - 1, n, k - 1, z - 1, ans + arr[c - 1]))

def check(arr, val):
	a = -1
	for i in range(len(arr)):
		if arr[i][len(arr[i]) - 1] == val:
			a = i
			break
	return a

def reverse(s, i, ans):
	if i >= len(s):
		return ans
	else:
		return reverse(s, i + 1, s[i] + ans)

def update(arr, i, j, n, m):
	if i >= 0 and i < n and (j >= 0) and (j < m):
		if arr[i][j] == 1:
			arr[i][j] == 2
			return [i, j]
	return [-1, -1]

def mergesort(arr):
	n = len(arr)
	if n == 1:
		return arr
	else:
		n = n // 2
		a1 = arr[0:n]
		a2 = arr[n:len(arr)]
		l1 = mergesort(a1)
		l2 = mergesort(a2)
		return merge(l1, l2)

def merge(arr1, arr2):
	i1 = 0
	i2 = 0
	res = []
	n1 = len(arr1)
	n2 = len(arr2)
	while i1 < n1 and i2 < n2:
		if arr1[i1] <= arr2[i2]:
			res.append(arr1[i1])
			i1 += 1
		else:
			res.append(arr2[i2])
			i2 += 1
	while i1 < n1:
		res.append(arr1[i1])
		i1 += 1
	while i2 < n2:
		res.append(arr2[i2])
		i2 += 1
	return res

def mergeSort(arr):
	if len(arr) > 1:
		mid = len(arr) // 2
		L = arr[:mid]
		R = arr[mid:]
		mergeSort(L)
		mergeSort(R)
		i = j = k = 0
		while i < len(L) and j < len(R):
			if L[i] < R[j]:
				arr[k] = L[i]
				i += 1
			else:
				arr[k] = R[j]
				j += 1
			k += 1
		while i < len(L):
			arr[k] = L[i]
			i += 1
			k += 1
		while j < len(R):
			arr[k] = R[j]
			j += 1
			k += 1
t = int(input())
for i in range(t):
	(a, b) = map(int, input().split(' '))
	val = abs(a - b)
	if val % 10 == 0:
		print(val // 10)
	else:
		print(val // 10 + 1)


import sys, math, cmath, time
start_time = time.time()

def solve():
	(a, b) = invr()
	print(math.ceil(abs(a - b) / 10))

def main():
	global tt
	if not ONLINE_JUDGE:
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	t = 1
	t = inp()
	for tt in range(t):
		solve()
	if not ONLINE_JUDGE:
		print('Time Elapsed :', time.time() - start_time, 'seconds')
		sys.stdout.close()

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	return input().strip()

def invr():
	return map(int, input().split())

def counter(a):
	q = [0] * max(a)
	for i in range(len(a)):
		q[a[i] - 1] = q[a[i] - 1] + 1
	return q

def counter_elements(a):
	q = dict()
	for i in range(len(a)):
		if a[i] not in q:
			q[a[i]] = 0
		q[a[i]] = q[a[i]] + 1
	return q

def string_counter(a):
	q = [0] * 26
	for i in range(len(a)):
		q[ord(a[i]) - 97] = q[ord(a[i]) - 97] + 1
	return q

def factors(n):
	q = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			q.append(i)
			q.append(n // i)
	return list(sorted(list(set(q))))

def prime_factors(n):
	q = []
	while n % 2 == 0:
		q.append(2)
		n = n // 2
	for i in range(3, int(n ** 0.5) + 1, 2):
		while n % i == 0:
			q.append(i)
			n = n // i
	if n > 2:
		q.append(n)
	return list(sorted(q))

def transpose(a):
	(n, m) = (len(a), len(a[0]))
	b = [[0] * n for i in range(m)]
	for i in range(m):
		for j in range(n):
			b[i][j] = a[j][i]
	return b

def factorial(n, m=1000000007):
	q = 1
	for i in range(n):
		q = q * (i + 1) % m
	return q
ONLINE_JUDGE = __debug__
if ONLINE_JUDGE:
	input = sys.stdin.readline
main()


import math as m
t = int(input())
for _t in range(t):
	(a, b) = map(int, input().split())
	diff = m.ceil(abs(a - b) / 10)
	print(diff)


from math import ceil

def main():
	for test in range(int(input())):
		(a, b) = map(int, input().split())
		print(solution(a, b))

def solution(a, b):
	return ceil(abs(a - b) / 10)
main()


import sys
import math
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
x = inp()
l = []
for i in range(x):
	(y, z) = invr()
	l.append(math.ceil(abs(y - z) / 10))
for i in l:
	print(i)


import sys, math, heapq, copy
from collections import defaultdict, deque
from bisect import bisect_left, bisect_right
from functools import cmp_to_key
t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	d = abs(a - b)
	print(math.ceil(d / 10))