add 数论基础 唯一分解定理(算术基本定理).
This commit is contained in:
parent
7d65b8c204
commit
ab7ad7c09e
25
luogu/njit-baidu2023/tb.py
Normal file
25
luogu/njit-baidu2023/tb.py
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import io
|
||||||
|
import sys
|
||||||
|
|
||||||
|
sys.stdin = io.StringIO('''4
|
||||||
|
100 98
|
||||||
|
42 32
|
||||||
|
1000000000000000000 1
|
||||||
|
41 40''')
|
||||||
|
|
||||||
|
|
||||||
|
# 数论基础 唯一分解定理(算术基本定理)
|
||||||
|
# x - n*p = y
|
||||||
|
# 则 n*p = x - y = z
|
||||||
|
# 大于1的整数就满足 可分解为任意素数乘积
|
||||||
|
def fun(x, y):
|
||||||
|
z = x - y
|
||||||
|
return z > 1
|
||||||
|
|
||||||
|
|
||||||
|
t = int(input())
|
||||||
|
for _ in range(t):
|
||||||
|
print('YES' if fun(*map(int, input().split())) else 'NO')
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
pass
|
Loading…
Reference in New Issue
Block a user