DCP-20: Back to School Back to All Problems

Beginner Geometry > Basic Geometry

When we were young students in school we did many wonderful math but most of us forget it over time. Sometimes is it nice to recall those memories and refresh our math a bit. In today’s contest we will try something like that. Consider you are given information about a circle (center and radius) and you are given information of a point (coordinate), you have to tell whether the point is outside the circle, or inside the circle or on the circle. If the point is on the perimeter of the circle then it is consider on the circle. ![circle][1] In this example, **A** is outside the circle, **B** is inside the circle and **C** is on the circle. Input: ------ First line of the input will consist of an integer which represent the test case **T (0 < T <= 100)**. Each test case contains 5 numbers Cx, Cy, R, Px, Py. Here Cx, Cy are two non-negative integers that represents the coordinate of the center of the circle, R is a double **(R > 0)** representing radius of the circle. Px, Py are two non-negative integers representing the coordinate of the point to investigate. Cx, Cy, R, Px, Py all will be less than 1000. Output: ------- For each test case print “**Case X: Y**” (without quotes) where **X** is the number of test case (start from 1). And **Y** will be either “**Outside**”, or “**Inside**”, or “**OnCircle**” (without quotation marks) depending on the outcome of your investigation. Sample Input ------------ 3 305 233 233.83 52 877 213 351 733.20 125 986 0 25 25.00 0 0 Sample Output ------------- Case 1: Outside Case 2: Inside Case 3: OnCircle [1]: https://s3-ap-southeast-1.amazonaws.com/devskillimagestorage/questionimages/57357b98-b299-c609-ad1f-08d2e26c0366_80a9da94ac9042d7a1e81c5e6583edb9_W189xH142.png

Problem Setter:

MD. Jalal Uddin

Please login to submit solution to this problem.

Problem Limits

Language Time Limit (seconds)
C 1.00
C++ 1.00
C++14 1.00
C# 2.00
Go 2.00
Java 2.00
JavaScript 2.00
Objective-C 2.00
Perl 2.00
PHP 2.00
Python 2.00
Python3 2.00
Ruby 2.00
VB.Net 2.00

Problem Stats




# User Language Timing
01 orvi2015 Cpp14 0.00s
02 maksbd19 Cpp14 0.00s
03 asiuzzaman006 Cpp14 0.00s
04 ash12 Cpp14 0.00s
05 akib9ctg Cpp 0.00s
06 duronto20 Cpp 0.00s
07 shawon100 Cpp14 0.00s
08 zitul_mahmud Cpp14 0.00s
09 absa1am Cpp14 0.00s
10 Core_i14 Cpp14 0.00s
11 Saimum_140128 Cpp14 0.00s
12 mamunparvez Cpp14 0.00s
13 Nazmul0092 Cpp14 0.00s
14 haasib Cpp14 0.00s
15 biswajitdas Cpp14 0.00s
16 reza_ul Cpp14 0.00s
17 Masum_ice Cpp14 0.00s
18 gazi93 Cpp14 0.00s
19 lazyfahim Cpp14 0.00s
20 mubdiur Cpp 0.00s
21 maxhasan Cpp14 0.00s
22 The_Viper Cpp 0.00s
23 deder Cpp14 0.00s
24 non_coder Cpp14 0.00s
25 Brokenlog Cpp14 0.00s
26 mir_lutfur_rahman Cpp 0.00s
27 rakibul1415 Cpp14 0.00s
28 shahad_mahmud Cpp14 0.00s
29 Rayhanpatoary Cpp14 0.00s
30 afzalul Cpp14 0.00s
31 Light_Yagami407 Cpp14 0.00s
32 frshafi Cpp14 0.00s
33 Sabyasachi Cpp14 0.00s
34 virus Cpp14 0.00s
35 junayedmahmud C 0.00s
36 Sajal_Deb Cpp14 0.00s
37 feodorv C 0.00s
38 atmfaisal Cpp14 0.00s
39 Mr_KAJOL Cpp14 0.00s
40 SaMi_012 Cpp14 0.00s
41 inam Cpp 0.00s
42 rafsandevs Cpp14 0.00s
43 MarufAhmed Cpp14 0.00s
44 Beauty Cpp14 0.00s
45 Agent007 Cpp14 0.00s
46 Nazmul_7 Cpp14 0.00s
47 Rakib05 Cpp14 0.00s
48 mir003 Cpp 0.00s
49 Atika17 Cpp 0.00s
50 terminator_c Cpp14 0.00s

Your feedback is our precious!

Or call +88 02 9853138 for support