bad qs implementation
codeforces round 200