codeforces-scrape

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

74A.md (2957B)


      1 Source: https://codeforces.com/problemset/problem/74/A
      2 
      3 A. Room Leader
      4 
      5 time limit per test
      6 
      7 2 seconds
      8 
      9 memory limit per test
     10 
     11 256 megabytes
     12 
     13 input
     14 
     15 stdin
     16 
     17 output
     18 
     19 stdout
     20 
     21 Let us remind you part of the rules of Codeforces. The given rules slightly simplified, use the problem statement as a formal document.
     22 
     23 In the beginning of the round the contestants are divided into rooms. Each room contains exactly *n* participants. During the contest the participants are suggested to solve five problems, *A*, *B*, *C*, *D* and *E*. For each of these problem, depending on when the given problem was solved and whether it was solved at all, the participants receive some points. Besides, a contestant can perform hacks on other contestants. For each successful hack a contestant earns 100 points, for each unsuccessful hack a contestant loses 50 points. The number of points for every contestant is represented by the sum of points he has received from all his problems, including hacks.
     24 
     25 You are suggested to determine the leader for some room; the leader is a participant who has maximum points.
     26 
     27 Input
     28 
     29 The first line contains an integer *n*, which is the number of contestants in the room (1 ≤ *n* ≤ 50). The next *n* lines contain the participants of a given room. The *i*-th line has the format of "*handle**i* *plus**i* *minus**i* *a**i* *b**i* *c**i* *d**i* *e**i*" — it is the handle of a contestant, the number of successful hacks, the number of unsuccessful hacks and the number of points he has received from problems *A*, *B*, *C*, *D*, *E* correspondingly. The handle of each participant consists of Latin letters, digits and underscores and has the length from 1 to 20 characters. There are the following limitations imposed upon the numbers:
     30 
     31 * 0 ≤ *plus**i*, *minus**i* ≤ 50;
     32 * 150 ≤ *a**i* ≤ 500 or *a**i* = 0, if problem *A* is not solved;
     33 * 300 ≤ *b**i* ≤ 1000 or *b**i* = 0, if problem *B* is not solved;
     34 * 450 ≤ *c**i* ≤ 1500 or *c**i* = 0, if problem *C* is not solved;
     35 * 600 ≤ *d**i* ≤ 2000 or *d**i* = 0, if problem *D* is not solved;
     36 * 750 ≤ *e**i* ≤ 2500 or *e**i* = 0, if problem *E* is not solved.
     37 
     38 All the numbers are integer. All the participants have different handles. It is guaranteed that there is exactly one leader in the room (i.e. there are no two participants with the maximal number of points).
     39 
     40 Output
     41 
     42 Print on the single line the handle of the room leader.
     43 
     44 Examples
     45 
     46 Input
     47 
     48 ```
     49 5  
     50 Petr 3 1 490 920 1000 1200 0  
     51 tourist 2 0 490 950 1100 1400 0  
     52 Egor 7 0 480 900 950 0 1000  
     53 c00lH4x0R 0 10 150 0 0 0 0  
     54 some_participant 2 1 450 720 900 0 0
     55 ```
     56 
     57 Output
     58 
     59 ```
     60 tourist
     61 ```
     62 
     63 Note
     64 
     65 The number of points that each participant from the example earns, are as follows:
     66 
     67 * Petr — 3860
     68 * tourist — 4140
     69 * Egor — 4030
     70 * c00lH4x0R —  - 350
     71 * some_participant — 2220
     72 
     73 Thus, the leader of the room is tourist.