Arm Coordination
Question
Solution
Idea
This is a give-away question also. The easiest way is to get the four coordinates as follows:
(x-r, y+r)
(x-r, y-r)
(x+r, y-r)
(x+r,y+r)
Code
https://github.com/mendax1234/Coding-Problems/blob/main/kattis/armcoordination/armcoordination.c
#include <stdio.h>
int main()
{
long x, y, r;
scanf("%ld %ld", &x, &y);
scanf("\n%ld", &r);
printf("%ld %ld\n", x-r, y+r);
printf("%ld %ld\n", x-r, y-r);
printf("%ld %ld\n", x+r, y-r);
printf("%ld %ld\n", x+r, y+r);
}
Last updated