#include int main(int argc, char* argv[]) { int K = 0; int N = 0; double n[200][2] = {0}; int c[400]; int i,j,k,l,m; int slices; int maxslices = 1; int temp; int final; double pi = 3.141592654; double ssize = 0; double start; ifstream infile("probe.in"); ofstream outfile("probe.out"); infile >> K; infile.getline((char*)NULL, 100); for (i = 0; i < K; i++) { outfile << "Data Set " << i+1 << ": "; maxslices = 1; infile >> N; infile.getline((char*)NULL, 100); for (j = 0; j < 400; j++) { c[j] = 0; } for (j = 0; j < 200; j++) { c[j] = 0; n[j][0] = 0; n[j][1] = 0; } for (j = 0; j < N; j++) { infile >> n[j][0]; infile >> n[j][1]; n[j][0] += 2*pi; } for (slices = 2; slices < 200; slices++) { ssize = (2*pi) / slices; for (int k = 0; k < N; k++) { start = n[k][0]; for (int l = 0; l < slices; l++) c[l] = 0; for (int m = 0; m < N; m++) { for (l = 0; l < slices; l++) { if (n[m][0]-start >= 0) { if (n[m][0]-start >= l*ssize && n[m][0]-start < (l+1)*ssize) c[l]++; } else { if (n[m][0]-start+ (2*pi) >= l*ssize && n[m][0]-start+ (2*pi) < (l+1)*ssize) c[l]++; } } } final = 1; temp = c[0]; for (l = 1; l < slices; l++) if (temp != c[l]) final = 0; if (final == 1) {/* for (m = 0; m < slices; m++) cout << c[m] << "\n";*/ maxslices = slices; } } } outfile << maxslices << " slices\n\n"; } infile.close(); outfile.close(); return 0; }