You will be given the coordinates of the centres and the radii of two circles. Your task is to find the area of their intersection.

**Input: **

The first line of input contains a single integer **T** denoting the number of test cases. Then **T** test cases follow. Each test case consists of one line. This line has six space separated integers denoting **x _{1}, y_{1}, r_{1}, x_{2}, y_{2}, r_{2}** where (

**Note:** Use the value of Pi as 3.1415926535897932384

**Output:**

Corresponding to each test case, in a new line, print the greatest integer less than or equal to the area of intersection of the two circles. See floor function here.

**Constraints:**

1 ≤ **T** ≤ 100

-10^{9} ≤ **x _{1}, y_{1}, x_{2}, y_{2}** ≤ 10

1 ≤ **r _{1}, r_{2}** ≤ 10

**Example:**

**Input**

3

0 0 4 6 0 4

0 0 5 11 0 5

0 0 10 9 0 1

**Output**

7

0

3

**Explanation:**

For the first case, the area of intersection comes out to be around 7.25298806, the greatest integer less than or equal to this is 7.

In the second case, there is no area common to the two given circles, hence the answer is 0.

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

hardikJain5 | 234 |

CodeBuddy | 196 |

bhatabhi554 | 172 |

Akkki111 | 169 |

clone | 166 |

KshatriyaYash | 1932 |

nikhil_sojan | 1374 |

lonecoder | 1236 |

SumitSingh27 | 1127 |

mazumderrohit8 | 1108 |

blackshadows | 5327 |

Ibrahim Nash | 5219 |

akhayrutdinov | 5111 |

mb1973 | 4587 |

Quandray | 4444 |

Login to report an issue on this page.