Guessing the Greatest (hard version)

Problem Name:
Guessing the Greatest (hard version)
Site:CodeForces
Links:
Tags:
Problem setters: