I’ve written code in Java for FLOORI4 problem, and i’ve tested it using random inputs (for worst cases combined) like T=3030 and 1<=N<=10^6 (3000 cases) and 10^6<= N <= 10^10 (30 cases) and 1<=M<=10^5, on my machine it runs in 4.5 secs approx and for individual cases(separately) it runs within 2.5 sec bound, but here i get TLE. But some people code got accepted even in 14 sec limit.

I am unable to figure out that how to compare our system time with platform time, so that i may know how much to optimize.