How can i write long longs in C/C++?
Some compilers, such as Dev-C++, require you to use %I64d with scanf/printf. However, for your code to work on Codechef, use %lld instead.
Or simply use cout.
Along with the line std::ios_base::sync_with_stdio(false); at the beginning of main to speed up cout/cin