Shooting Contest

Здравейте отново :smiley:, някой би ли могъл да ми обясни защо на “draw” ако смятам по дадената ми формула не се пада на аутпут да бъде “draw” ?

Защо трябва това да прави “draw” ?
4 targets
4x1 + ( 5 + 1 ) = 10 Gosho
4x5 + (5 + 3) = 28 Pesho

Shooting Contest

George and Peter (aka Gosho & Pesho) are participating in an online shooting contest. The game is simple - everyone will receive N amount of targets to hit and the first who hits all targets wins the round.

However, George and Peter shoot at different speeds and accuracy, so for example George will hit a target roughly once every Gs seconds, while Peter will need roughy Ps seconds.

Additionally, George and Peter are playing from different PCs and there is a variable amount of latency for each one of them - Gl and Pl .

So for example, the server sends the targets to George, which takes Gl seconds, Gosho shoots all targets with his shooting speed, and then the response back to the server take another Gl seconds.

Your task is to write a program which will determine if George or Peter will win the current round, or there will be a draw.

Input

Read from the standard input:

  • On the first line - the number N - the number of targets.
  • On the second line - Gs - George’s speed.
  • On the third line - Gl - George’s latency.
  • On the fourth line - Ps - Peter’s speed
  • On the fifth line Pl - Peter’s latency.

Output

Print to the standard output:

  • There is one line of output:
    • George - if George wins
    • Peter - if Peter wins
    • Draw - if the amount it takes is the same for both of them

Constraints

  • 1 <= N, Gs, Gl, Ps, Pl <= 232

Sample Tests

Input

5
1
1
2
2

Output

George

Description

There are 5 targets. 
George's speed is 1 and the latency is 1. The latency is applied twice. So (5 targets * 1 sec) = 5 + 1 sec + 1 sec = 7 sec
Peter's speed is 2 and the latency is 2. The latency is applied twice. So (5 targets * 2 sec) = 10 + 2 sec + 2 sec = 14 sec

So George wins this round!

Input

3
3
1
1
1

Output

Peter

Input

4
5
1
3
5

Output

Draw

Здравей,
формулата ти трябва да изглежда така при 4 цели:
Gosho = (4x5) + 1 + 1 = 22
Pesho = (4x3) + 5 + 5 = 22
Формулата е (targets X speed) + latency + latency

Мерси, понеже в условието така са го направили в обяснението където са еднакви входните данни, че нищо не се разбира. Аз разбрах latency is applied twice първо от резултата targetxlatency + latency+speed, понеже така пак два пъти се аплайва.

Здравейте! Моля ви за помощ, защо този код не минава в джъдж:

n = int(input())
Gs = int(input())
Gl = int(input())
Ps = int(input())
Pl = int(input())

score_G = n * Gs + Gl*2
score_P = n * Ps + Pl*2

if score_G < score_P:
    print("George")
elif score_G > score_P:
    print("Petar")
elif score_G == score_P:
    print("Draw")

Задачата изглежда прекалено лесна и това ме е подвело да сбъркам, но нямам идея кое е правилното решение.