Problem description is available here. Please use stdin/stdout, don't read file(s).
Migrated from old NTUJ.
Wuhan Regional 2009