← All problemsSign in

Mask Policy

CodeChefRating 1064Open on judge ↗

A city has been infected by a contagious virus. In a survey, it was found that $A$ out of the $N$ people living in the city are currently infected. It has been observed that the only way for a person to get infected is if he comes in contact with an already infected person, and both of them are NOT wearing a mask. The mayor of the city wants to make a new Mask Policy and find out the minimum num

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