Logo
(追記) (追記ここまで)

10353번 - Frame 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
5 초 256 MB281997834.211%

문제

Let's consider a X×Y rectangle with the middle (X – 2)×(Y – 2) rectangle cut out. We will call this figure a frame with size X×Y. Picture 1 shows the frame 5 × 6.

Let's assume that we have unlimited number of tiles with size A×1. We consider the following problem: is it possible to completely pave a frame with size X×Y using these tiles (tiles can be rotated by 90 degrees). For example, frame 5×6 from Picture 1 can be paved completely with tiles of size 3×1 (one way to do so is shown in Picture 2), but can’t be paved with tiles of size 4×1.

입력

The first input line contains 2 integers – X and Y (3 ≤ X ≤ 106, 3 ≤ Y ≤ 106). The second line contains integer N – the number of tile types to be analyzed (1 ≤ N ≤ 1000). Each of following N lines contains one integer, not exceeding 106. We designate with AK the integer on the (k+2)-th line of the input file.

출력

Your goal is to print N lines, where the K-th line should contain the word "YES", if it is possible to tile the frame with size X × Y with tiles AK × 1, and the word "NO" otherwise.

제한

예제 입력 1

5 6
2
3
4

예제 출력 1

YES
NO

힌트

출처

ICPC > Regionals > Europe > Southeastern European Regional Contest > SEERC 2014 D번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /