Please tell why I'm getting TLE in subtask 2 in GOLMINE june lunctime'20

https://www.codechef.com/viewsolution/34849528

Use double instead of float and use fastio ( check gfg ).
the input size was big and in these cases fastio makes a big difference