404695: GYM101611 F Fake or Leak?

Memory Limit:512 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

F. Fake or Leak?time limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard output

In Someland a great programming competition was held. The scoreboard is now frozen, and everyone is waiting for the final results announcement. At the same time, a group of hackers published a screenshot with the part of the final unfrozen scoreboard. However, looking on the published part of the scoreboard you have started to doubt it is not a fake.

You are given the frozen scoreboard and what is claimed to be a part of the final scoreboard. You have to find out whether it is possible that you are given a real part of the final scoreboard.

The rules of this competition are as follows:

  1. There are m teams participating and n problems available to solve.
  2. The contest lasts for five hours. The scoreboard is frozen after four hours.
  3. Each time a team submits a solution for some problem, this submission is either accepted or rejected. Each team is allowed to submit each problem multiple times. A team never submits a solution for a problem for which it already made a successful submission.
  4. Teams are ranked according to the most problems solved.
  5. Teams that have solved the same number of problems are ranked by total time (the less the better) and, if need be, by the earliest time of the last accepted submission.
  6. The total time is the sum of the time consumed for each problem solved. The time consumed for a solved problem is the time elapsed from the beginning of the contest to the submittal of the first accepted run plus 20 penalty minutes for every previously rejected run for that problem. There is no time consumed for a problem that is not solved.
  7. If two or more teams are still tied by the total number of problems solved, the total time consumed and the time of the last accepted submission, they are ranked by their names in lexicographical order.

You are given a frozen scoreboard and what is claimed to be k consecutive lines of the final scoreboard. Your goal is to check whether it is possible that the claim is true.

Input

The first line of the input contains three integers n, m and k (1 ≤ n ≤ 26, 1 ≤ k ≤ m ≤ 1000) — the size of the problem set, the number of teams participating, and the size of the leaked part of the final scoreboard.

In the next m lines, the results of the teams in the frozen scoreboard are listed from top to bottom, i.e. from the best to the worst result. Then follow k lines describing the allegedly leaked continuous part of the final scoreboard.

Each line that describes the results of a team obeys the following format. The line starts with a team name. The name is a non-empty string of at most 10 lower-case English letters. Then follow n triples c, a, t (0 ≤ a ≤ 100, 0 ≤ t ≤ 299), describing the results of this team for each problem. The character c is one of '+', '-', or '.', meaning the team has already solved this problem, the team has made some unsuccessful attempts and haven't solved this problem yet, or the team has never attempted this problem respectively. Integer a stands for the number of submissions, and integer t stands for the minute when the last submission was made.

It is guaranteed that both scoreboards are self-consistent and non-contradictory. In particular, that means:

  1. All names in the frozen scoreboard are distinct. All names in the allegedly leaked part of the final scoreboard are distinct. Any name that is present in the allegedly leaked part of the scoreboard is present in the frozen scoreboard.
  2. If some c equals '+' or '-', the corresponding value of a is positive.
  3. If some c equals '.', the corresponding values of a and t are 0.
  4. If some a equals 0, corresponding value of t is 0 and c is '.'.
  5. Both the frozen scoreboard and the allegedly leaked part have teams ranked according to the rules described above.
  6. All values of t in the frozen scoreboard do not exceed 239.
  7. Any team's results present in the allegedly leaked scoreboard is consistent with its results in the frozen scoreboard. Let c1, a1 and t1 be some team's result for some problem in the frozen scoreboard, and c2, a2 and t2 be results of the same team for the same problem in the allegedly leaked part of the scoreboard. Then,
    • a1 ≤ a2;
    • if a1 = a2, then c1 = c2 and t1 = t2;
    • if c1 =  '+', then c2 = '+' and a1 = a2;
    • if a1 < a2, then c1 is either '-' or '.', c2 is either '+' or '-', and t2 ≥ 240.
Output

If it is possible that the last k lines of the input are k consecutive lines of the final scoreboard, print "Leaked" (without quotes). Otherwise, print "Fake" (without quotes).

ExamplesInput
3 3 2
crabs + 1 1 + 1 2 + 1 3
lions . 0 0 - 5 239 . 0 0
wombats . 0 0 . 0 0 . 0 0
wombats + 1 241 + 3 299 - 22 299
lions + 1 241 + 6 240 - 3 299
Output
Leaked
Input
3 4 2
crabs + 1 1 + 1 2 + 1 3
lions . 0 0 + 5 239 . 0 0
wolves . 0 0 . 0 0 . 0 0
wombats . 0 0 . 0 0 . 0 0
crabs + 1 1 + 1 2 + 1 3
wombats . 0 0 + 2 299 . 0 0
Output
Fake

加入题单

上一题 下一题 算法标签: