Prime Distance
题号:NC50552
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 32 M,其他语言64 M
64bit IO Format: %lld

题目描述

给定两个整数L,R,求闭区间[L,R]中相邻两个质数差值最小的数对与差值最大的数对。当存在多个时,输出靠前的素数对。

输入描述:

多组数据。每行两个数L,R。

输出描述:

详见输出样例。
示例1

输入

复制
2 17
14 17

输出

复制
2,3 are closest, 7,11 are most distant.
There are no adjacent primes.

备注:

对于全部数据,