Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <math.h>
- #include <ctype.h>
- #include <time.h>
- #pragma warning(disable:4996 6031)
- int main(){
- int n, i;
- long long x0, y0, dx, dy, xc, yc, r;
- char input[128] = { 0 };
- fgets(input, 127, stdin);
- sscanf(input, "%d", &n);
- fgets(input, 127, stdin);
- sscanf(input, "(%lld, %lld)", &x0, &y0);
- fgets(input, 127, stdin);
- sscanf(input, "%lld%lld%lld", &xc, &yc, &r);
- for(i = 0; i < n; i++){
- fgets(input, 127, stdin);
- sscanf(input, "(%lld, %lld)", &dx, &dy);
- x0 += dx; y0 += dy;
- }
- if(((xc - x0) * (xc - x0) + (yc - y0) * (yc - y0)) <= (r * r)){
- puts("N0 WAY!");
- }
- else{
- printf("(%lld, %lld)\n", x0, y0);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement