Your reasoning is flawed. Consider:
if(v.size()>=ff){
ans = pi*v[ff-1];
printf("%0.4f\n" ,ans);
}
So in other words, if there are at least enough pies to go around, you can give everybody a piece with size equal to that of the smallest pie, right?
Well this isn't going to work. What about a case like this:
1
2 1
1 100
There is one friend, so two people in total. There are two pies, one really big (r = 100) and one really small (r = 1).
Your output:
3.1416
That is, each person gets a piece equal in area to the smaller pie.
Correct output:
15707.963
The optimal solution is for you and your friend to split the large pie, leaving the small one untouched.
Here's a hint on how to solve this problem: Let's say each person is to get a piece of size X, can you determine whether or not this is possible?