← All problemsSign in

JU BB Match

A pitching machine pitches ***N*** balls in a baseball practice session. A batsman plays all the balls. If he hit the ball, he scores one run but if he misses the hit, he loses one run in his score. Now, if he hit at least ***N/2*** hits, he is rewarded with the bonus of ***N/2*** runs. Find out the total score of the batsman. ### Input - The first line consists of a single integer ***N***,

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start