## Mock CCC '22 Contest 2 J2 - Snowboarding Championship

View as PDF

Points: 3
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type

Andrew has somehow made it to the alpine snowboarding finals! He is up against his long-time rival Tommy.

Each snowboarder will be going down their own hill, with obstacles. The obstacle in Andrew's hill has height , and the obstacle in Tommy's hill has height . Andrew can jump meters high, meaning he can clear all obstacles strictly less than meters, while Tommy can jump meters high. The snowboarders can jump over the obstacles in second while going around them takes seconds. If a snowboarder cannot jump over that obstacle, they will go around it.

Given the heights of the obstacles in each hill, and the snowboarders' jumping height, determine who wins the race. The winner is the snowboarder who finishes the course in less time.

#### Input Specification

The first line contains three space-separated integers: , the number of obstacles on each course, , Andrew's jump height, and , Tommy's jump height.

The next lines contain two space-separated integers and , the height of the obstacle in Andrew's hill and Tommy's hill, respectively.

#### Output Specification

Output Andrew wins! if Andrew wins, Tommy wins! if Tommy wins, and Tie! otherwise.

5 4 3
1 2
4 5
6 2
4 4
1 7

Tie!

#### Explanation

Andrew completes the course in seconds, and Tommy completes the course in seconds as well.

• commented on Oct. 31, 2022, 9:08 p.m. edited

I have the correct code but for my print it says this: print("Andrew wins!")

i have no idea whats wrong

• commented on Feb. 20, 2022, 4:04 p.m.

I will never be happy about the fact that it took me like 10 minutes because I thought the higher time wins.

• commented on May 29, 2022, 12:57 a.m.

same