Dcoder icon

The Running Race @ Dcoder

By Lochard | As a newbie programmer | 29 Apr 2023


Problem: Alex and Ryan are having a running competition between themselves. They have to cover a distance of D meter. The speed of Alex and Ryan are X meter/second and Y meter/second respectively. Help the judge by telling him who will win the competition.

Input: Input consists of a single line, contains 3 integers D, X and Y .

Output: Print "Alex" if Alex wins, print "Ryan" if Ryan wins. If it is a draw print "Draw".

Constraints: 1<=D,X,Y<=100

Sample Input: 10 2 3

Sample Output: 

Ryan

d, x, y = map(int, input().split())
if x > y:
  print('Alex')
elif y > x:
  print('Ryan')
else:
  print('Draw')

How do you rate this article?

1


Lochard
Lochard

20240228 Arrived in the UK for about 2 week. All my fears persist. Some are even getting worse. https://github.com/locharp/asylum_diary/


As a newbie programmer
As a newbie programmer

Sharing entry level codes. My snippets on GitHub https://github.com/locharp/code-snippets

Publish0x

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.