Solved by 734 users: ...
UserDateAttemptTimeCMSC
Nakilon`12 jan 2010`Ruby100.0342
abortmozga.ru`03 jun 2009`C++1700.0161
sb3ar`23 dec 2007`Ruby600.0262
Vladislav_Simonenko`20 mar 2006`FPC300.0263
PetrovSergey`06 jan 2005`FPC2?.??70
kornakovBSU`21 dec 2010`C++700.0171
sb3ar`28 apr 2007`Ruby300.0272
Senya`16 nov 2009`C++200.0273
abortmozga.ru`03 jun 2009`C++1500.0174
abortmozga.ru`03 jun 2009`C++1400.0175
QWE`05 nov 2007`Kylix400.0278
DAV`03 jun 2009`C++400.0278
david_it21`16 apr 2008`Ruby100.0378
DAV`03 jun 2009`C++500.0279
kornakovBSU`26 jul 2009`C++200.0181
 C++ 344 FPC 205 C 108 Kylix 37 Java 30 Ruby 8 Python 4 Haskell 1 Perl 1
` >  >  >  >  >  >  >  >  >  > `

## Frame paving

Time limit = 5

Frame X x Y is rectangle X x Y with center rectangle (X — 2) x (Y — 2) dropped out. We have many tiles A x 1.

Is it possible to cave frame X x Y with tiles A x 1?

For example, frame 5 x 6 can be tiled with tiles 3 x 1, but not with tiles 4 x 1.

Input The first line contains two positive integers X and Y (3 ≤ X, Y ≤ 106). The second line containe one positive integer N — number of tile types, (1 ≤ N ≤ 1000). The third line contains N positive integers less than 106 — lengths of tiles.

Output N lines with YES or NO. i-th line contains YES if it is possible to tile the frame with tiles of i-th type. Output NO otherwise.

 Input#1```5 6 2 3 4 ``` Output#1```YES NO ```

Author:
Kvasov Igor
21 May 2003

<PREV | Problem set | Search related messages | NEXT>

 © acm.mipt DevGroupThe page was generated in 200ms