Skip to content

Instantly share code, notes, and snippets.

@shemul
Created September 2, 2015 20:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shemul/202a4cdd5fc2d9dd022a to your computer and use it in GitHub Desktop.
Save shemul/202a4cdd5fc2d9dd022a to your computer and use it in GitHub Desktop.
বৃত্তের ভিতরে বিন্দু ( Point Inside Circle )
/**<
problem : https://algo.codemarshal.org/problems/55184554742a2fff09a42faa
author : shemul
reference : https://www.youtube.com/watch?v=1-Q_BQ0ypmg
*/
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include <math.h>
using namespace std ;
int main () {
double cx , cy , R , px , py ,result,radius;
int testcase ;
cin >>testcase ;
for(int i = 1 ; i <= testcase ; i++) {
cin >> cx >> cy >> R >> px >> py ;
result = pow(px-cx,2) + pow(py-cy,2);
radius = pow(R,2);
if(radius >= result) {
cout << "Case " <<i <<": yes\n";
} else {
cout << "Case " <<i <<": no\n";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment