BAISED Problem I am getting correct output but wrong Answer on SPOJ

use long long int
because ranks are large
after that you will get AC