Mock CCC '20 Contest 1 J1 - Loss

View as PDF

Submit solution

Points: 3 (partial)
Time limit: 2.0s
Memory limit: 128M

Author:
Problem type

Chris has a number of $1, $5, $10, and $20 bills in his pocket. Nayaab also has a number of $1, $5, $10, and $20 bills in her pocket. Can you determine who has more money?

Input Specification

  • The first line will contain the number of $1 bills Chris has.
  • The second line will contain the number of $5 bills Chris has.
  • The third line will contain the number of $10 bills Chris has.
  • The fourth line will contain the number of $20 bills Chris has.
  • The fifth line will contain the number of $1 bills Nayaab has.
  • The sixth line will contain the number of $5 bills Nayaab has.
  • The seventh line will contain the number of $10 bills Nayaab has.
  • The eighth line will contain the number of $20 bills Nayaab has.

Each person will have at most 100 of each type of bill and at least 0.

Output Specification

Output Chris if Chris has more money, Nayaab if Nayaab has more money, and Tie if they both have the same amount of money.

Sample Input

4
3
2
6
2
4
3
5

Sample Output

Chris

Explanation For Sample

Chris has a total of 4 + 3 \times 5 + 2 \times 10 + 6 \times 20 = 159 dollars, while Nayaab has 2 + 4 \times 5 + 3 \times 10 + 5 \times 20 = 152 dollars.


Comments

There are no comments at the moment.