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.

Vagesh Verma | 98 |

UrGuru | 98 |

chaolinyu | 84 |

prernaus24 | 83 |

devendrachoudhary5485 | 74 |

abducodes | 624 |

harshtyagi36 | 298 |

highway_to_hell | 252 |

rajeswarii | 248 |

arpit_anshuman | 240 |

blackshadows | 5331 |

Ibrahim Nash | 5219 |

akhayrutdinov | 5111 |

mb1973 | 4929 |

Quandray | 4567 |

Login to report an issue on this page.