P6850 NOI
Background
Little L is a newbie.
Little L, who cannot do anything, went to the NOI exam venue.
Description
Since Little L cannot do arithmetic, he now tells you his score for each problem and the team cutoff line. Please tell him whether he gets into the team.
The NOI score is calculated as follows:
1. The written test starts with $50$ points, and for each solved problem, add $1$ point.
2. The final score is the sum of the scores of all problems plus the written test score.
3. If it is Category A, add another $5$ points on top of that total.
Input Format
Input $9$ numbers $a,b,c,d,e,f,g,h,i$, representing respectively: the number of problems solved in the written test; the scores of D1T1, D1T2, D1T3, D2T1, D2T2, D2T3; whether it is Category A (yes is $1$, no is $0$); and the CTT cutoff score.
Output Format
Output one string on one line.
If he gets into the CTT, output `AKIOI`.
If he does not, output `AFO`.
Explanation/Hint
#### "Sample Explanation"
In the first sample is retired newbie Little L's NOI2020 result.
In the second sample is some team leader's NOI2020 result.
~~Isn't this explaining nothing~~.
---
#### "Constraints and Notes"
**This problem uses bundled testdata**. You can get the score of a subtask only if you pass all test points in that subtask.
- Subtask 1 (30 points): $h = 0$, $a = 50$, $i = 700$;
- Subtask 2 (30 points): $h = 0$, $a = 50$;
- Subtask 3 (40 points): no special restrictions.
For all data, $0\leq a \leq 50$, $0\leq b,c,d,e,f,g \leq 100$, $0 \leq h \leq 1$, $205\leq i \leq 705$.
The tie case for the $50$-th place is not considered here. You may assume that if there is a tie, Little L has priority.
The testdata is not guaranteed to be real results.
Translated by ChatGPT 5