#E. 一道普普通通的题

    Type: Default 1000ms 256MiB

一道普普通通的题

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Background

这是一道普普通通的简单题。

Description

小z先给你一个的1*n的矩阵,

再先给你一个的1*m的矩阵.

请你分别在这两个矩阵中各取一个元素,使它们差的绝对值最小.

判断这个绝对值是否是素数。

(注意:这两个元素不在同一个矩阵)

Format

Input

第一行输入n,m (0n,m1000\leq n,m \leq 100 )

第二行输入一个由n个仅由0~9整数组成的矩阵a

第三行输入一个由m个仅由0~9整数组成的矩阵b

Output

如果是素数,输出“YES”;

否则,输出“NO”.

Samples

5 5
12345
67891
NO

Limitation

1s, 1024KiB for each test case.

SWPU ROUND #5(DIV.2)

Not Attended
Status
Done
Rule
IOI
Problem
8
Start at
2021-12-4 9:00
End at
2021-12-4 12:00
Duration
3 hour(s)
Host
Partic.
30