Language: C++

#include <iostream>
#include <sstream>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <complex>
using namespace std;

typedef long long LL;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vector<int> > vii;
typedef vector<vector<string> > vss;
typedef pair<int, int> pii;
#define INF 0x7fffffff
//#define INFLL 0x7fffffffffffffff
#define INFLL LLONG_MAX
#define SIZE(v) int((v).size())
#define ALL(v) (v).begin(), (v).end()
#define FOR(i,x) for(int i=0;i<x;i++)
#define FORic(i,y,x) for(int i=y;i<=x;i++)
#define FORdc(i,y,x) for(int i=y;i>=x;i--)
#define FILL(a,v) memset(a, v, sizeof(a))
#define PI 3.1415926535897932384

using namespace std;

const double EPS = 1e-7;
typedef complex<double> P; /* _ */
struct L { P p, q; L(P p, P q) : p(p), q(q) {} };
typedef vector<P> G;

// àÏEOÏEpx(xNga,bÌZ)
double dot(P a, P b) { return real(conj(a)*b); }
double cross(P a, P b) { return imag(conj(a)*b); }
double angle(P a, P b) { return arg(conj(a)*b); }

// _ÌWðó¯æèCÊïðÔ·(¼üãÉ é_ÍEÁÄ¢È¢)
// EPSð-EPSÉÏ¦éÆ¼üãÉ é_àE¤çµ¢ªEEH
G convexHull(G ps){
	int n = ps.size();
	int k = 0;
	if(n<3) return ps;
	FORic(i,0,n-2){
		FOR(j,i+1,n-1){
			//if(make_pair(real(ps[i]),imag(ps[i])) > make_pair(real(ps[j]),imag(ps[j])) ){
				P temp = ps[i];
				ps[i] = ps[j];
				ps[j] = temp;
			//}
		}
	}
	G g(2*n);
	for(int i=0; i<n; g[k++] = ps[i++]){
		while(k>1 && cross((g[k-1]-g[k-2]),(ps[i]-g[k-1])) <= EPS) k--;
	}
	for(int i=n-2, t=k; i>=0; g[k++] = ps[i--]){
		while(k>t && cross((g[k-1]-g[k-2]),(ps[i]-g[k-1])) <= EPS) k--;
	}
	g.resize(k-1);
	return g;
}




int main(){
	int N, R, Q;
	while(cin>>N>>R>>Q){
		if(!N&&!R&&!Q) break;
		G are;
		FOR(i, N){
			int x, y;
			cin>>x>>y;
			are.push_back(P(x,y));
		}
		G all = convexHull(are);
		int start;
		P now;
		double maxdist = 0.0;
		FOR(i,N){
			double dist = all[i].real()*all[i].real() + all[i].imag()*all[i].imag();
			if(dist>maxdist){
				start = i;
				now = all[i];
				maxdist = dist;
			}
		}
		vector<double> dlist;
		FOR(i, Q){
			int tugi = start-1;
			if(tugi<0) tugi = N-1;
			P nagasa = all[start] - all[tugi];
			double d2 = nagasa.real()*nagasa.real() + nagasa.imag()*nagasa.imag();
			double d = sqrt(d2);
			dlist.push_back(d);
		}
		FOR(i, Q){
			double coss = (R*R*2-dlist[i]*dlist[i])/(2*R*R);
			double ang = acos(coss);
			P rot = P(cos(ang),sin(ang));
			P next = now*rot;
			P nagasa = next;
			double d2 = nagasa.real()*nagasa.real() + nagasa.imag()*nagasa.imag();
			double d = sqrt(d2);
			printf("%.10f %.10f\n", next.real(),next.imag());
			//cout<<d<<endl;
			now = next;
		}
	}
	return 0;
}

Compiler output:
a.cc:51:30: error: macro "FOR" passed 3 arguments, but takes just 2
   51 |                 FOR(j,i+1,n-1){
      |                              ^
a.cc:26:9: note: macro "FOR" defined here
   26 | #define FOR(i,x) for(int i=0;i<x;i++)
      |         ^~~
a.cc: In function 'G convexHull(G)':
a.cc:51:17: error: 'FOR' was not declared in this scope
   51 |                 FOR(j,i+1,n-1){
      |                 ^~~