Timer is Running

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.

visutkarsh2000 | 251 |

ayushaggarwal821 | 248 |

ashishboss9977 | 236 |

tekuripurushotham | 178 |

ramharshrai1999 | 151 |

abnandi04 | 776 |

KshamaGupta | 499 |

ponnadasaikesav | 450 |

ayushaggarwal821 | 415 |

yogesh_aka_dante | 405 |

blackshadows | 5362 |

Ibrahim Nash | 5244 |

akhayrutdinov | 5111 |

mb1973 | 4976 |

Quandray | 4752 |

Login to report an issue on this page.