Descriptions:

Exam in BerSU (easy version)

CodeForces - 1185C1