codeforces-scrape

Codeforces scraped problems and editorials
git clone git://git.laack.co/codeforces-scrape.git
Log | Files | Refs | README

100A.md (985B)


      1 Source: https://codeforces.com/problemset/problem/100/A
      2 
      3 A. Carpeting the Room
      4 
      5 time limit per test
      6 
      7 2 seconds
      8 
      9 memory limit per test
     10 
     11 64 megabytes
     12 
     13 input
     14 
     15 stdin
     16 
     17 output
     18 
     19 stdout
     20 
     21 Soroush's room is a square with side length *n*. Before this contest he bought *k* fine Persian carpets to carpet his room for celebrating the 100th contest on his favorite site. Each Persian carpet is a square of side length *n*1.
     22 
     23 Soroush wants to cover all the area of his room. Carpets can be put over each other but it is not allowed to rotate the carpets. Can Soroush carpet his room completely?
     24 
     25 Input
     26 
     27 The input consists of three integer numbers *n*, *k* and *n*1 (10 ≤ *n* ≤ 12, 1 ≤ *k* ≤ 10, ![](https://espresso.codeforces.com/72f1942c84baf5bc0bba9b950b1605216412984e.png)).
     28 
     29 Output
     30 
     31 Write a single YES or NO. Write YES if and only if Sorush can carpet his room completely.
     32 
     33 Examples
     34 
     35 Input
     36 
     37 ```
     38 10 4 6
     39 ```
     40 
     41 Output
     42 
     43 ```
     44 YES
     45 ```
     46 
     47 Input
     48 
     49 ```
     50 10 2 5
     51 ```
     52 
     53 Output
     54 
     55 ```
     56 NO
     57 ```