Last updated 1 month ago
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)
#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); }