codeforces; use static_cast to shut the compiler warnings