codeforces-scrape

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

413A.md (2322B)


      1 Source: https://codeforces.com/problemset/problem/413/A
      2 
      3 A. Data Recovery
      4 
      5 time limit per test
      6 
      7 1 second
      8 
      9 memory limit per test
     10 
     11 256 megabytes
     12 
     13 input
     14 
     15 stdin
     16 
     17 output
     18 
     19 stdout
     20 
     21 Not so long ago company R2 bought company R1 and consequently, all its developments in the field of multicore processors. Now the R2 laboratory is testing one of the R1 processors.
     22 
     23 The testing goes in *n* steps, at each step the processor gets some instructions, and then its temperature is measured. The head engineer in R2 is keeping a report record on the work of the processor: he writes down the minimum and the maximum measured temperature in his notebook. His assistant had to write down all temperatures into his notebook, but (for unknown reasons) he recorded only *m*.
     24 
     25 The next day, the engineer's assistant filed in a report with all the *m* temperatures. However, the chief engineer doubts that the assistant wrote down everything correctly (naturally, the chief engineer doesn't doubt his notes). So he asked you to help him. Given numbers *n*, *m*, *min*, *max* and the list of *m* temperatures determine whether you can upgrade the set of *m* temperatures to the set of *n* temperatures (that is add *n* - *m* temperatures), so that the minimum temperature was *min* and the maximum one was *max*.
     26 
     27 Input
     28 
     29 The first line contains four integers *n*, *m*, *min*, *max* (1 ≤ *m* < *n* ≤ 100; 1 ≤ *min* < *max* ≤ 100). The second line contains *m* space-separated integers *t**i* (1 ≤ *t**i* ≤ 100) — the temperatures reported by the assistant.
     30 
     31 Note, that the reported temperatures, and the temperatures you want to add can contain equal temperatures.
     32 
     33 Output
     34 
     35 If the data is consistent, print 'Correct' (without the quotes). Otherwise, print 'Incorrect' (without the quotes).
     36 
     37 Examples
     38 
     39 Input
     40 
     41 ```
     42 2 1 1 2  
     43 1
     44 ```
     45 
     46 Output
     47 
     48 ```
     49 Correct
     50 ```
     51 
     52 Input
     53 
     54 ```
     55 3 1 1 3  
     56 2
     57 ```
     58 
     59 Output
     60 
     61 ```
     62 Correct
     63 ```
     64 
     65 Input
     66 
     67 ```
     68 2 1 1 3  
     69 2
     70 ```
     71 
     72 Output
     73 
     74 ```
     75 Incorrect
     76 ```
     77 
     78 Note
     79 
     80 In the first test sample one of the possible initial configurations of temperatures is [1, 2].
     81 
     82 In the second test sample one of the possible initial configurations of temperatures is [2, 1, 3].
     83 
     84 In the third test sample it is impossible to add one temperature to obtain the minimum equal to 1 and the maximum equal to 3.