DCP-9: Kick the Football Back to All Problems

Easy Math > Basic Math


In Bangladesh a reputed software company - DESME Bangladesh is working on large scale game projects in Cloud like Football, Cricket etc. Recently they have started recruiting. It’s a very challenging job. For this task, knowledge of mathematics and physics is necessary so for the interview the candidates were instructed to review their knowledge in physics and mathematics and the interview board wants to make sure that no one can pass this interview without these knowledge. Now think you are going to this company for an interview and you have to prove that you have basic knowledge on mathematics and physics. They give you the following problem in the interview and asked you to write to code. If you pass, you are hired! Think about a football match, the goalkeeper shoots the ball and a player receives that ball in the field. In this case, the player can only receive the ball if the ball hits the player. For this problem we consider that the field is 2D. The goalkeeper always shoots the ball from the (0, 0) coordinate of the field and the motion of the football is always that of a [projectile][1] ([http://en.wikipedia.org/wiki/Projectile_motion][2]). Resistances like air or other frictions are not considered in this game field. All the players are in front of the goalkeeper and if the ball hits any player after shooting the ball then that player will receive that ball. The gravity is same as earth gravity (=9.8). You have to find the player who receives the football. Input: ------ The first line of the input contains the test case, **T< 20**. Each test case contains: - The initial velocity of the ball, 0 < u < 150 ms-1 - The angle at which the ball is shot, 10 < a < 90 degree - The number of players, 0 < n < 11 - Next n lines will contain each player’s details as following: A) The position of the player in the field : x, y1, y2, y1<y2 and (y2-y1)>=5. From these coordinates two coordinates for the leg and head positions are to be extracted. For both the leg(x,y1) and head(x,y2) coordinates the value of ‘x’ will be equal. No two players will ever share the same x-coordinate value. B) Player name. Output: ------- For each test case first print a line “**Case X:**” without double quote, where **X** denoting the current test case number then print the player’s name who receives the ball “Ball is received by ” string. If no player receives the ball, print “No one received the ball” without quote. Please follow the sample I/O section. Sample Input ------------ 3 40 60 3 43 30 60 Messi 42 30 40 Xavi 44 30 60 Pele 40 60 4 42 30 40 Messi 44 30 60 Pele 43 30 60 CR7 90 30 60 Neymar 40 60 1 10 20 40 Neymar Sample Output ------------- Case 1: Ball is received by Messi Case 2: Ball is received by CR7 Case 3: No one received the ball [1]: http://en.wikipedia.org/wiki/Projectile_motion [2]: http://en.wikipedia.org/wiki/Projectile_motion


Problem Setter:

Md. Azizur Rahman Faiem

Please login to submit solution to this problem.

Problem Limits

Language Time Limit (seconds)
C 1.00
C++ 1.00
C++14 1.00
C# 2.00
Go 2.00
Java 2.00
JavaScript 2.00
Objective-C 2.00
Perl 2.00
PHP 2.00
Python 2.00
Python3 2.00
Ruby 2.00
VB.Net 2.00

Problem Stats

7/19

Solve/Submission

Ranking

# User Language Timing
01 MAHRahat Cpp14 0.00s
02 parthapratimbanik Cpp14 0.00s
03 njrafi Cpp14 0.00s
04 feodorv Cpp 0.00s
05 jalal Cpp14 0.29s
06 amit_bd Java 1.88s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support