Not able to find whats wrong in the approach

Hi,
I am trying a problem on codechef and coded the solution to the problem.
Problem Link :- https://www.codechef.com/FEB20B/problems/SNUG_FIT

Solution Link:-https://ide.codingblocks.com/s/177507

My approach is that the max area of circle depends on the max radius and that in turn increases with increased diameter and the diameter is always be minimum of length and width of the rectangle. so to get max l,w i sorted both length and width array so that max lengths gets with max width to get max diameter.

but this approach is not even working for subtask#1 .please tell me whats wrong with my approach i am not able to find .

Hello @Anujg935

Change “int” to “long long int” because the answer could go beyond the range of “int” as
1 <= Ai,Bi <= 10^9

The answer can be upto 10^13 (10^4 * 10^9)

hi @prashuk156 thanks it worked now