{{{~cpp #include #include using namespace std; struct Cherry { int x; int y; double gradient; }; vector Gradient; void input(int x, int y) { Cherry temp; temp.x = x; temp.y = y; temp.gradient= (double)y/x; Gradient.push_back(temp); } void process(int num) { for(int k = 0; k Gradient[j].gradient) { temp.gradient = Gradient[j].gradient; Gradient[j].gradient = Gradient[k].gradient; Gradient[k].gradient = temp.gradient; } } } int b = (Gradient[num/2].x + Gradient[num/2 + 1].x)*(-1); int a = Gradient[num/2].y + Gradient[num/2 + 1].y; cout << a << " " << b <> numCherry; if(numCherry == 0) break; for(i = 0; i<2*numCherry; i++) { cin >> x >> y; input(x, y); } process(numCherry); } return 0; } }}} [BirthdayCake]