The Number of Imposters

CodeForces - 1594D