Problem
Chef is playing in a T20 cricket match. In a match, Team A plays for 20 overs. In a single over, the team gets to play 6 times, and in each of these 6 tries, they can score a maximum of 6 runs. After Team A's 20 overs are finished, Team B similarly plays for 20 overs and tries to get a higher total score than the first team. The team with the higher total score at the end wins the match.
Chef is in Team B. Team A has already played their 20 overs, and have gotten a score of . Chef's Team B has started playing, and have already scored runs in the first overs. In the remaining overs, find whether it is possible for Chef's Team B to get a score high enough to win the game. That is, can their final score be strictly larger than ?
Input:
- There is a single line of input, with three integers, .
Output:
Output in a single line, the answer, which should be "YES" if it's possible for Chef's Team B to win the match and "NO" if not.
You may print each character of the string in uppercase or lowercase (for example, the strings "yEs", "yes", "Yes" and "YES" will all be treated as identical).
Constraints
Sample Input 1:
719 18 648
Sample Output 1:
YES
### Explanation:
In the remaining overs, Team B gets to play times, and in each try, they can get a maximum of 6 score. Which means that the maximum score that they can acheieve in these 2 overs is . Thus, the maximum total score that Team B can achieve is . is strictly more than Team A's score of , and hence Chef's Team B can win this match.
Sample Input 2:
720 18 648
Sample Output 2:
NO
### Explanation:
Similar to the previous explanation, the maximum total score that Team B can achieve is , which isn't strictly greater than Team A's .Hence Chef's Team B can't win this match.
Program :
#include <stdio.h>
int main()
{
int R,O,C;
scanf("%d%d%d",&R,&O,&C);
int a=20-O;
int b=(a*6*6)+C;
if(R<b)
printf("YES\n");
else
printf("NO\n");
return 0;
}
0 Comments