yes
Time Limit: 1 seconds
Memory Limit: 128 MB
Rating: 1500
Problem StatementThe angry birds need your help hitting the bad piggies! The ground can be imagined as a number line, where the angry birds start at position $0$. You are given an integer $n$, the position of the bad piggie. You have one angry bird, which you need to launch into the air at an initial velocity of $v$ $m/s$. The bird will be launched with angle $θ$ to the horizontal. Your goal is to hit the bad piggie with the angry bird. Given integers $n$ and $θ$, calculate the initial velocity you need to launch the angry bird to the nearest integer. You may assume that there is no air resistance. Take g as $9.81$ $ms^{-2}$ (acceleration due to gravity). You can model the angry bird as a particle.
InputOn the first line, you are given integer $n$ $(1 \le n \le 5 \cdot 10^7)$. On the second line, you are given integer angle $θ$ in degrees $(0 < θ < 90)$.
OutputOn the first line, output the answer described in the Problem Statement.
Sample CasesSample Input 1: 17 50 Sample Output 1: 13 Sample Input 2: 27 33 Sample Output 2: 17Explanation
Not available for this problem.
SourcesKL Coding Cup March 2023 > Angry Birds > Problem 3
Submit | Back