Voting rule working in CPP