{"trustable":true,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e .prewrap { white-space: pre-wrap; } pre, code, .mono, .mono * { font-family: monospace !important; }\u003c/style\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\n\u003cspan class\u003d\"mono prewrap\" id\u003d\"probtext-text\"\u003eProblem 1: Cow Curling [Brian Dean, 2014]\n\nCow curling is a popular cold-weather sport played in the Moolympics. \n\nLike regular curling, the sport involves two teams, each of which slides N\nheavy stones (3 \u0026lt;\u003d N \u0026lt;\u003d 50,000) across a sheet of ice. At the end of the\ngame, there are 2N stones on the ice, each located at a distinct 2D point.\n \nScoring in the cow version of curling is a bit curious, however. A stone\nis said to be \"captured\" if it is contained inside a triangle whose corners\nare stones owned by the opponent (a stone on the boundary of such a\ntriangle also counts as being captured). The score for a team is the\nnumber of opponent stones that are captured. \n\nPlease help compute the final score of a cow curling match, given the\nlocations of all 2N stones.\n\nPROBLEM NAME: curling\n\nINPUT FORMAT:\n\n* Line 1: The integer N.\n\n* Lines 2..1+N: Each line contains 2 integers specifying the x and y\n coordinates of a stone for team A (each coordinate lies in the\n range -40,000 .. +40,000).\n\n* Lines 2+N..1+2N: Each line contains 2 integers specifying the x and\n y coordinates of a stone for team B (each coordinate lies in\n the range -40,000 .. +40,000).\n\nSAMPLE INPUT (file curling.in):\n\n4\n0 0\n0 2\n2 0\n2 2\n1 1\n1 10\n-10 3\n10 3\n\nINPUT DETAILS:\n\nEach team owns 4 stones. Team A has stones at (0,0), (0,2), (2,0), and\n(2,2), and team B has stones at (1,1), (1,10), (-10,3), and (10,3).\n\nOUTPUT FORMAT:\n\n* Line 1: Two space-separated integers, giving the scores for teams A\n and B.\n\nSAMPLE OUTPUT (file curling.out):\n\n1 2\n\nOUTPUT DETAILS:\n\nTeam A captures their opponent\u0027s stone at (1,1). Team B captures their\nopponent\u0027s stones at (0,2) and (2,2).\n\u003c/span\u003e\n"}}]}