On their way down the river, Jojo and Lili saw two frogs in X1 and X2 respectively. The two frogs are seen jumping up and down happily in the same direction, which is coming to Jojo. After noticing the two frogs, Jojo and Lili noticed that the speed of the two frogs was different. The first frog to start jumping from the X1 position has a speed of V1, while the second frog that starts jumping from the X2 position has a V2 speed. Jojo guessed that the "YES" of the two frogs would be in the same position in a given T time, while Bibi guessed the "NO" of the two frogs would never be in the same position in that time. Help Jojo and Lili take into account the frog's movements to determine if their guess is correct.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

Help Me With C Programming

 

On their way down the river, Jojo and Lili saw two frogs in X1 and X2 respectively. The two frogs are seen jumping up and down happily in the same direction, which is coming to Jojo. After noticing the two frogs, Jojo and Lili noticed that the speed of the two frogs was different. The first frog to start jumping from the X1 position has a speed of V1, while the second frog that starts jumping from the X2 position has a V2 speed. Jojo guessed that the "YES" of the two frogs would be in the same position in a given T time, while Bibi guessed the "NO" of the two frogs would never be in the same position in that time. Help Jojo and Lili take into account the frog's movements to determine if their guess is correct.

Format Input
The first line of input consists of a series of integers namely X1, V1, X2, V2, T.
X1 and V1 are the starting positions and jumping speeds per second of the first frog. X2 and V2 are the starting positions and jumping speeds per second frog.
T is the second when the frog jumps.

Format Output
A string of "YES" or "NO"

 

[Look at Image]

 

In the sample above, for example frogs A and B begin to compete to jump.
Frog A starts jumping from position 0 at a speed of 3 per second.
Then the position of frog A per second: 3, 6, 9, 12, 15,... Dst.
Frog B starts jumping from position 4 at a speed of 2 per second.
Then the position of frog B per second: 6, 8, 10, 12, 14,... Dst.
Within 3 seconds, the two frogs will NOT be in the same position. Both frogs can be in the same position in the fourth second, which is in the 12th position. So that within 10 seconds the output is YES while within 3 seconds the output is NOT.

 

Constraints
1<T< 10*
0< X1,X2< 104
1<V1,V½ < 10*
Sample Input
0 3 4 2 10
Sample Output
YA
Sample Input
0 3 4 2 3
Sample Output
TIDAK
Transcribed Image Text:Constraints 1<T< 10* 0< X1,X2< 104 1<V1,V½ < 10* Sample Input 0 3 4 2 10 Sample Output YA Sample Input 0 3 4 2 3 Sample Output TIDAK
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education