SOLVE

LATER

Two points and a circle

Problem

Editorial

Analytics

There is a two-dimensional plane that contains multiple points at different locations. The coordinates of these points are provided in the **Coordinates** table.

There is also a circle of radius **r** and coordinates **(x,y)** of the center on the same plane. The specifications of the circle are provided in the **Circle** table.

Assuming that there is only one circle, write a query to return the points, which are either lying inside or outside the circle. The points must be in the order of the ID of each point.

Table: **Coordinates**

Field | Type |
---|---|

id | Integer |

x1 | integer |

y1 | integer |

Table: **Circle**

Field | Type | Remarks |
---|---|---|

r | Integer | radius of circle |

x | integer | coordinate x is the center of the circle |

y | integer | coordinate y is the center of the circle |

ID | x1 | y1 |
---|---|---|

1 | 10 | 20 |

2 | 20 | 10 |

3 | 5 | 10 |

4 | 10 | 5 |

5 | 30 | 5 |

6 | 5 | 30 |

r | x | y |
---|---|---|

5 | 10 | 10 |

ID | x1 | y1 |
---|---|---|

3 | 5 | 10 |

4 | 10 | 5 |

Time Limit:
5 sec(s)
for each input file.

Memory Limit:
256 MB

Source Limit:
1024 KB

Marking Scheme:
Marks are awarded when all the testcases pass.

Allowed Languages:
MySQL,
PostgreSQL,
MSSQL,
Oracle_Db

Initializing Code Editor...

OTHER PROBLEMS OF THIS CHALLENGE

{"172b576": "/pagelets/recommended-problems/sql/two-points-and-a-circle-11/", "09ab6fe": "/pagelets/show-submission/sql/two-points-and-a-circle-11/", "f728dd6": "/pagelets/problem-author-tester/sql/two-points-and-a-circle-11/", "e554903": "/pagelets/problems-hint/sql/two-points-and-a-circle-11/", "0e2ce00": "/pagelets/suggested-problems/sql/two-points-and-a-circle-11/"}

realtime.hackerearth.com

80

e2b5de4c8ee6c1a7c6bce30efbb8eae65cd891c5

58a29e5cae2309f04b28

/realtime/pusher/auth/