Statistics

Problem Statement for "MissileTarget"

Problem Statement

You are working for a defense agency that is testing the accuracy of a new missile guidance system. As part of this effort, several missiles have been fired off. Each missile fired was programmed with the same target coordinates, although the actual points of impact vary.

Your task is to determine the "best fit" point to describe the location where the missiles actually landed. To determine how well a point describes the location, calculate the cartesian distance from the point to each of the landing points. Then, total the sum of the squares of these distances. The best fit point is the point that minimizes this sum.

You are given int[]s x and y, both containing the same number of elements, where the i-th element of x and the i-th element of y describe the coordinates of the i-th missile landing point. You are to return a int[] with exactly two elements, describing the coordinates of the lattice point (point with integral coordinates) that is closest to the "best fit" point. The first element should be the x-coordinate, and the second element should be the y-coordinate.

Definition

Class:
MissileTarget
Method:
bestFit
Parameters:
int[], int[]
Returns:
int[]
Method signature:
int[] bestFit(int[] x, int[] y)
(be sure your method is public)

Notes

  • The cartesian distance between two points (x1, y1) and (x2, y2) is defined as Sqrt((x2-x1)^2 + (y2-y1)^2).
  • The return value must be within 1e-9 absolute or relative error of the actual result.

Constraints

  • x will contain between 1 and 50 elements, inclusive.
  • x and y will contain the same number of elements.
  • Each element of x will be between -1000000 and 1000000, inclusive.
  • Each element of y will be between -1000000 and 1000000, inclusive.
  • The actual (possibly non-lattice) best fit point will be at least 1e-2 closer to the correct return value than to any other lattice point.

Examples

  1. {750, -500, -250}

    {-1000, 500, 500}

    Returns: {0, 0 }

    These three impacts are all pretty close to the origin, and sure enough, the origin is the best fit point.

  2. {765}

    {834}

    Returns: {765, 834 }

    With only one point, it is its own best fit.

  3. {100, 200}

    {200, 400}

    Returns: {150, 300 }

    With only two points, the best fit is the midpoint between the two.

  4. {123456, -987654, 97531, -86420}

    {14703, 25814, 36924, -47036}

    Returns: {-213272, 7601 }

  5. {0}

    {0}

    Returns: {0, 0 }

  6. {28335,-162923,-142494,831252,679913,-800762,320337,294813,233078,-791802,788088,-92327,846158,-486021,-64314,770053,-156508,268559,932200,499749,996687,282119,972087,638389,305865,-320708}

    {-693555,557676,280913,-944584,-225735,-134357,722736,-867220,-166324,-687101,4501,916879,93198,198884,852894,352657,342992,278114,629365,-519236,86111,166434,111379,93804,-430254,247266}

    Returns: {256532, 48748 }

  7. {-107419,-683519,77861,569480,-857646,155540,295549,211825,-170914,-245964,-976013,-45266,-684309,-351776,779411,874500,498289,774751,-123118,650933,462448,-498099,336544,-151393,-360556,160853,289866,698114,-537494,76922,885896,377310,523063,-899183,-302491,792567,-773001,-360112,627661,860023,950902,-810627,315632,-713170,-301691}

    {-636349,-956716,-147591,255967,-572505,141305,-810307,850071,327314,-104538,-933616,302519,-777590,-47151,-833804,-312835,516227,228139,370111,486064,-612405,309833,537627,-754275,-178010,-633490,788005,733361,-857224,553078,281524,-406866,-957542,-82978,-499272,502416,-886070,-195346,31678,828026,881731,767369,845197,-217512,333285}

    Returns: {50937, -34292 }

  8. {-921874,80281,950160,86495,-685427,94085,-760686,727333,-632841,511034,764347,324598,558272,-511036,676747,548825,501316,312667,747144,-786878,381958,-449866,896558,-320571,739384}

    {-291188,-772349,764763,-252456,391852,555975,-852533,-3596,-45646,-558779,273465,-226805,-340375,-281526,-237492,843665,335424,529457,-685576,733325,-469788,853783,-884628,-491296,-830595}

    Returns: {153281, -77717 }

  9. {744087,-941403,-288379,-162124,578130,875313,804932,-572425,-299855,335927,443110,952982,304102,-516471,621884,51913,601548,308477,-504815,-112424,227859,529643,31397,-820180,148489,-124337,-830395,736386,-934780,866192,-524149,484151,322413,93147,-700622,-999614,-686744,1965,-571118}

    {-455996,-613984,-827156,248762,586806,250288,-897998,-604629,844733,883245,-517081,-86736,809120,935886,-12407,911451,777939,639292,547786,719643,-612946,-789131,136276,544505,641473,-239396,48107,625905,-553413,697309,-318161,893166,-360564,-365124,820798,121309,519945,-201475,414323}

    Returns: {12159, 157997 }

  10. {-117818,931054,-140978,-773637,-454396,699089,780017,288088,-613690,599333,-687807,492825,-131710,364819,881458}

    {-312135,-925327,871158,-514023,3701,238980,-457213,-522564,510281,-223628,259224,-157714,373251,-185099,-238687}

    Returns: {141110, -85320 }

  11. {-109044,553657,544436,-989547,-827664,-618121,542678,66998,-651104,-686375,-136838,-741625,816266,287005,-683442,277581,120465}

    {-211043,-932949,757061,-10844,761498,913591,-575037,-137110,7971,-928859,-238609,926360,-900699,-548064,154651,-360353,-219762}

    Returns: {-131451, -90717 }

  12. {557501,-230523,-124388,206012,-356598,920464,-303421,-578668,462771,-433639,946876,606480}

    {599225,581315,129064,878762,825836,-728888,450787,-759746,261378,-95572,231013,-640952}

    Returns: {139406, 144352 }

  13. {744082,-193710,850500,-599633,-421720,936996,-941519,476129,-248128,713583,-663370,-682049,697598,-37166,-170400,-383127,967336,154109,754311,847139,-236644,805597,181195,922443,969572,-609436}

    {315453,-647814,-317217,-256395,278303,897721,-756067,966894,-611777,-271398,769355,836429,942214,78840,-817979,-291708,497035,-596855,-257202,924889,650467,33183,-918312,-278795,322552,-666179}

    Returns: {185911, 31755 }

  14. {631056,536850,359382,-852965,-606671,701688,-990111,260454,-641752,-608596,-312679,488414,393609,-372393,-548143,275371,291038,660418,678133,122425,672240,249724,211483,-881436,-604755,-553571,-975801,-28080,-539335,-126297,371774,541013,417940,-491772,449154,-133998,271584,961457,-453013,699942,-112558,260854,-292121,540023}

    {-101062,131151,882633,-841173,113323,-224405,-413493,635582,-582076,-842802,55466,-112602,186402,-220010,-97578,-299469,-815012,-29736,273496,261628,978750,657830,504257,-811027,-162174,-342739,-724020,63746,143687,449152,271893,-538740,-704620,-538645,333427,482227,-884217,-149755,116464,783993,-242152,-218042,-752407,-888203}

    Returns: {20909, -95706 }

  15. {-786351,-19647,330022,706676,-825265,-648513,953435,-874015,-451847,-162808,-821551,-95444,-648399,509367,-585635,939483,-481204,691865,-685373,395436,180719,116740,-691934,110919,446867,-419497,630157,-495489}

    {686504,100365,-145737,-18882,-690095,570491,-77110,-161775,49618,-81752,-321067,-327853,-258301,-239541,-103072,284275,606977,-440352,-185698,-912672,-967712,280293,162623,-988395,851744,545074,698848,-88769}

    Returns: {-95760, -41856 }

  16. {-708876,236576,470411,433333}

    {926282,-822705,609677,-368741}

    Returns: {107861, 86128 }

  17. {541638,392139,-842591,286279,-499378,-570266,800969,-413441,-593089,789482,-14114,739325,326056,-600275,552129,349679,67748,956388,36928,-69074,-282930,-670781,-543970,560827,-334252,468050,-415052,37842,143395,809037,-259789,537387,248765,180915,-939389,768079,-518996,-788753,288460,627991,-229102,-767323,50832,360895,12125,689173,-359183,212521,-907499,42283}

    {298773,586799,-574765,-822618,993571,702112,980175,-690073,703849,-252453,-184940,-608303,-800740,539145,-893230,-982946,321724,-323852,682577,-170813,-233326,197254,-948611,-573639,-635688,736861,-64989,-231828,-139148,-818680,-700617,81792,199777,825191,885841,268222,-696917,-972522,242355,808543,352534,367897,-745209,-829842,-429093,303111,-821846,713058,-496754,-677013}

    Returns: {25162, -90586 }

  18. {-122479,82975,239442,826559,-229347,-802964,-983115,635342,420964,-483877,-250433,-132528,934046,-151538,-362196,46998,-637248,160484,407306,-878205,488459,233072,340419,-630183}

    {102301,817814,807385,-194652,-213567,-706751,-702419,-914754,195274,-178878,950780,915201,836758,2628,588392,-44022,353585,34666,-755282,229674,-695529,366090,-801798,25960}

    Returns: {-35335, 42452 }

  19. {-146047,-497323,-691663,-489138,419767,18615,-379614,-504873,205742,-55618,492013,-566529}

    {-768957,847482,345702,683437,-451961,195809,-97232,-293915,-101448,-611098,89603,347241}

    Returns: {-182889, 15389 }

  20. {289187,443926,618745,552174,253230,21035,-20296,692443,-337011,800056,-882261,-646956,-42935,-409808,230239,66815,161945,436978,-194394,-506456,-76740,-471479,-95490,-423774,-962970,601762,-58864,197307,-519084,848717,964433,334936,-54529,-677271,439367,-280784,865386,-155276,-471831,988453,-49256,409450,871588,345403,218269,-908263,870136}

    {713532,522576,452744,465339,-606748,587418,446204,420994,218183,536943,-175318,-895592,211395,926935,45818,767659,741663,-723929,-321417,328836,-820286,-902830,-690475,653296,-945520,-571561,949020,334910,709345,864727,-62479,-22683,458393,88772,-648190,975170,242667,902455,911250,795387,-213592,-241954,384027,758404,-746686,-210543,-506592}

    Returns: {90984, 151227 }

  21. {402785,-656512,323988,-150348,246171,-988916,227941,-82419,-796972,-841424,-768735,-929796,-242632,-41062,-59958,114283,-386101,-76965,-53322,897598,-645712,930871,736160,-409810,593404,-237159,-907703,465622,635567,130983,-996014,182217,-369200}

    {-789778,71444,564317,231084,669627,412469,-116473,-253404,203654,68687,639971,801973,-436597,911803,-156465,492550,-912137,-950153,-204877,40618,735165,-266568,-632096,951669,-386172,761995,-211437,-329350,14013,390053,918550,738211,-61228}

    Returns: {-113732, 118519 }

  22. {35329,446954,135298,-324390,-886367,997684,-373826,273784,606711,-844340,-259377,665301,-272428,-593155,645760,-526184,-769754,-385847,377839}

    {-284433,691029,-826297,373506,205617,289727,-328934,-498954,-535893,-909084,37516,591639,122508,-174811,206280,-529402,-170135,170400,-731210}

    Returns: {-55316, -121102 }

  23. {659057,532923,130930,553097,-986964,328895,669285,-340779,31086,765468,-612604,-78609,495067,122063,-427993,-895626,235666,-468388,-50686,654585,38650,-738182,-158785,231321,51115,-503604,821565,738028,687734,-383673,872417,-146463,37006,-18892,-959720,63324,-232489,210002}

    {592369,-809250,-465843,-36713,672847,-571678,-115571,223507,459081,868936,-335360,-923279,-182106,-462874,-73818,-6244,461810,-79680,331774,611452,-394695,86,61715,13914,121062,783382,-779870,513766,-803786,333805,741225,-66606,-511402,302845,795529,386203,783004,961133}

    Returns: {50680, 89491 }

  24. {0, 5, 5, 6, 8, 8}

    {0, 0, 0, 0, 0, 0}

    Returns: {5, 0 }

    In this case, notice that the actual best fit point possible is (5.333, 0). If we look at lattice points only, then our best fit is (6, 0), however, we are interested in the lattice point that is closest to the actual best fit point, so we return (5, 0).

  25. {93510, 93552, 93596, 93617, 93555, 93641, 93620, 93549, 93571, 93602, 93618, 93547, 93611, 93529, 93562, 93617, 93513, 93573, 93606, 93514, 93548, 93512, 93533, 93642, 93625, 93594, 93641, 93542, 93630, 93618, 93565, 93626, 93526, 93586, 93543, 93546, 93524}

    {588840, 588769, 588756, 588748, 588820, 588724, 588740, 588753, 588830, 588762, 588774, 588780, 588733, 588842, 588753, 588769, 588842, 588724, 588814, 588776, 588824, 588805, 588815, 588785, 588778, 588750, 588712, 588734, 588844, 588729, 588753, 588727, 588751, 588834, 588750, 588802, 588756}

    Returns: {93576, 588776 }

  26. {-137642, -137690, -137633, -137572, -137778, -137691, -137737, -137744, -137828, -137421, -137748, -137468, -137451, -137550, -137599, -137726, -137643, -137889, -137751, -137838, -137620, -137865, -137736, -137921, -137729, -137550, -137458, -137638, -137608, -137890, -137680, -137846}

    {141644, 141365, 141589, 141407, 141692, 141659, 141414, 141207, 141670, 141336, 141651, 141504, 141130, 141633, 141368, 141550, 141422, 141196, 141552, 141498, 141445, 141249, 141574, 141266, 141130, 141186, 141185, 141165, 141674, 141171, 141377, 141443}

    Returns: {-137686, 141417 }

  27. {-56115, -56366, -56677, -56346, -56216, -56511, -56188, -56475, -56734, -56307, -56682, -56426, -56563, -56361, -56145, -56210, -56363, -56688, -56138, -56176, -56207, -56539, -56728, -56428, -56595, -56439, -56557, -56564, -56316, -56219, -56138, -56727, -56502, -56348, -56284, -56486, -56681}

    {-103341, -103173, -102872, -103473, -103471, -103103, -103179, -103393, -103094, -103256, -103125, -103150, -103430, -103073, -102855, -103464, -102932, -103231, -102978, -102911, -102961, -103412, -103018, -103058, -102861, -103473, -102893, -102894, -103116, -103148, -102875, -102924, -103376, -103488, -102894, -103480, -103252}

    Returns: {-56417, -103152 }

  28. {387791, 387816, 387785, 387785, 387807, 387818, 387826, 387821, 387790, 387792, 387805, 387817, 387795, 387794, 387797, 387816, 387795, 387787, 387807, 387804, 387799, 387821, 387810, 387815, 387808, 387788, 387819, 387810, 387795}

    {219818, 219842, 219859, 219857, 219842, 219848, 219855, 219834, 219818, 219833, 219847, 219821, 219817, 219836, 219842, 219832, 219852, 219824, 219848, 219828, 219840, 219857, 219837, 219843, 219854, 219837, 219846, 219855, 219834}

    Returns: {387804, 219840 }

  29. {-141636, -141337, -141330, -141503, -141280, -141432, -141417}

    {150101, 150395, 150292, 150139, 150333, 150488, 150065}

    Returns: {-141419, 150259 }

  30. {313308, 313056, 313488, 313519, 313237, 313383, 313154, 313534, 313077, 313203, 313661, 313271, 313670, 313750, 313749, 313230, 313102, 313181, 313117, 313708, 313647, 313042, 313200, 313086, 313735, 313741}

    {84586, 84718, 84464, 84826, 85035, 84816, 85130, 84920, 85110, 84634, 84675, 85152, 84874, 84518, 84450, 84493, 85124, 85039, 84823, 85061, 84818, 84888, 84522, 84908, 84994, 85120}

    Returns: {313379, 84835 }

  31. {415237, 415382, 415169, 415188, 415151, 415298, 415147, 415390, 415369, 415181, 415405, 415414, 414980, 415129, 415083, 414986, 414931, 414994, 415235, 415369, 415469, 414958, 415239, 415152, 415480, 415341, 415514, 415019, 415289, 415080, 415512, 415416, 415025, 414914, 415281, 415338, 415334, 415452, 415415, 415353, 415521, 415523, 415289, 415142, 415558, 415048, 415057}

    {-22995, -23189, -23073, -23157, -23275, -23047, -23216, -23320, -22811, -22968, -23307, -23209, -22818, -23237, -22880, -23239, -23385, -23226, -23065, -23322, -23278, -23309, -23088, -23222, -23223, -22967, -22856, -22854, -22807, -23300, -23166, -22849, -22835, -22792, -23211, -22793, -22835, -23246, -23082, -22859, -23140, -23118, -22998, -23019, -22897, -23004, -23273}

    Returns: {415250, -23080 }

  32. {-51449, -51510, -51561, -51661, -51407, -51348, -51320, -51688, -51592, -51670, -51309, -51592, -51304}

    {-102685, -103015, -102757, -102779, -102847, -102939, -102607, -102716, -102928, -102920, -103005, -102634, -102829}

    Returns: {-51493, -102820 }

  33. {7757, 7718, 8252, 8320, 8298, 7884, 8339, 7923, 8164, 8340, 8184, 7790, 8138, 7961, 7800, 8344, 8222, 8247, 8206}

    {-12830, -12829, -12602, -12675, -12940, -12682, -13101, -12576, -13143, -12862, -12999, -12772, -12828, -12651, -12745, -12911, -13148, -12985, -12918}

    Returns: {8099, -12852 }

  34. {346470, 346340, 346370, 346343, 346426, 346359, 346424, 346351, 346440, 346471, 346281, 346339, 346417, 346362, 346404, 346338, 346304, 346452, 346420, 346463, 346289, 346360, 346295, 346438, 346374, 346320, 346313, 346482, 346494, 346360, 346473, 346411, 346395, 346413, 346484}

    {238416, 238304, 238299, 238423, 238244, 238274, 238417, 238346, 238328, 238318, 238239, 238401, 238333, 238259, 238297, 238227, 238423, 238283, 238415, 238308, 238396, 238282, 238325, 238395, 238287, 238297, 238218, 238412, 238311, 238285, 238275, 238279, 238286, 238371, 238258}

    Returns: {346391, 238321 }

  35. {400338, 400269, 400946, 400458, 400356, 400283, 400924, 400772, 400527, 400806, 400243, 400568, 400276, 400362, 400744, 400439, 400885, 400057, 400881, 400529, 400139, 400982, 400424, 400285, 400544, 400955, 400940, 400658, 400804, 400844, 400306, 400184, 400112, 400925, 400532, 400534, 400976, 400582, 400422, 400121, 400864, 400716, 400799, 400128, 400226, 400091}

    {92155, 92684, 92950, 92561, 92334, 92928, 92866, 92595, 92280, 92482, 92077, 92296, 93003, 92762, 92112, 92502, 92237, 92088, 92875, 92467, 92261, 92654, 92178, 92796, 92401, 92433, 92567, 92708, 92787, 92504, 92749, 92684, 92929, 92121, 92177, 92047, 92920, 92359, 92395, 92552, 92737, 92862, 92788, 92232, 92440, 92721}

    Returns: {400538, 92527 }

  36. {353962, 353970, 354473, 354070}

    {95293, 94918, 95149, 95341}

    Returns: {354119, 95175 }

  37. {64400, 64677, 64492, 64435, 64506, 64560, 64374, 64473}

    {420321, 420591, 420339, 420424, 420177, 420577, 420341, 420285}

    Returns: {64490, 420382 }

  38. {-58377, -58305, -57962, -58205, -58543, -57939, -58650, -58627, -58158, -58040, -58586, -58170, -58065, -57919, -58093, -58412, -58036, -58410, -57918, -58586, -57893, -58328, -58320, -57852, -58552, -58120, -57987, -58558, -58143, -58379, -58430, -58662, -58616, -58569, -58246, -58618, -58507, -58607}

    {439655, 439773, 440371, 439702, 439877, 440376, 440036, 440163, 439989, 440031, 440066, 440300, 440102, 440137, 439677, 440331, 439824, 440402, 440012, 440278, 439932, 440402, 440361, 439955, 440061, 439931, 440082, 440429, 439674, 440200, 439942, 440259, 440031, 440377, 440260, 440003, 439930, 440351}

    Returns: {-58300, 440086 }

  39. {404667, 405033, 404644, 404866, 405038, 404972, 404343, 404335, 404751, 405030, 404902, 405040, 404931, 404810, 404480, 404416, 404894, 404507, 404857, 404405, 404834, 404959}

    {434599, 434270, 434132, 434085, 434607, 434213, 433887, 434521, 434347, 434333, 434524, 434302, 434083, 434104, 434294, 434191, 433999, 434193, 434242, 434532, 434167, 433851}

    Returns: {404760, 434249 }

  40. {-174334, -174334, -174334, -174334, -174334, -174334, -174334, -174334, -174334, -174334, -174334, -174334, -174334, -174334, -174334, -174334, -174334, -174334, -174334, -174334, -174334, -174334, -174334, -174333, -174333, -174333, -174333, -174333, -174333, -174333, -174333, -174333, -174333, -174333, -174333, -174333, -174333, -174333, -174333, -174333, -174333, -174333, -174333, -174333, -174333, -174333, -174333, -174333, -174333}

    {115347, 115347, 115347, 115347, 115347, 115347, 115347, 115347, 115347, 115347, 115347, 115347, 115347, 115347, 115347, 115347, 115347, 115347, 115347, 115347, 115347, 115347, 115347, 115348, 115348, 115348, 115348, 115348, 115348, 115348, 115348, 115348, 115348, 115348, 115348, 115348, 115348, 115348, 115348, 115348, 115348, 115348, 115348, 115348, 115348, 115348, 115348, 115348, 115348}

    Returns: {-174333, 115348 }

  41. {489466, 489466, 489466, 489466, 489466, 489466, 489466, 489466, 489466, 489466, 489466, 489466, 489466, 489466, 489466, 489466, 489466, 489466, 489466, 489466, 489466, 489466, 489466, 489466, 489467, 489467, 489467, 489467, 489467, 489467, 489467, 489467, 489467, 489467, 489467, 489467, 489467, 489467, 489467, 489467, 489467, 489467, 489467, 489467, 489467, 489467, 489467, 489467, 489467}

    {471555, 471555, 471555, 471555, 471555, 471555, 471555, 471555, 471555, 471555, 471555, 471555, 471555, 471555, 471555, 471555, 471555, 471555, 471555, 471555, 471555, 471555, 471555, 471556, 471556, 471556, 471556, 471556, 471556, 471556, 471556, 471556, 471556, 471556, 471556, 471556, 471556, 471556, 471556, 471556, 471556, 471556, 471556, 471556, 471556, 471556, 471556, 471556, 471556}

    Returns: {489467, 471556 }

  42. {-119150, -119150, -119150, -119150, -119150, -119150, -119150, -119150, -119150, -119150, -119150, -119150, -119150, -119150, -119150, -119150, -119150, -119150, -119150, -119150, -119150, -119150, -119150, -119150, -119150, -119149, -119149, -119149, -119149, -119149, -119149, -119149, -119149, -119149, -119149, -119149, -119149, -119149, -119149, -119149, -119149, -119149, -119149, -119149, -119149, -119149, -119149, -119149, -119149}

    {197826, 197826, 197826, 197826, 197826, 197826, 197826, 197826, 197826, 197826, 197826, 197826, 197826, 197826, 197826, 197826, 197826, 197826, 197826, 197826, 197826, 197826, 197826, 197827, 197827, 197827, 197827, 197827, 197827, 197827, 197827, 197827, 197827, 197827, 197827, 197827, 197827, 197827, 197827, 197827, 197827, 197827, 197827, 197827, 197827, 197827, 197827, 197827, 197827}

    Returns: {-119150, 197827 }

  43. {269082, 269082, 269082, 269082, 269082, 269082, 269082, 269082, 269082, 269082, 269082, 269082, 269082, 269082, 269082, 269082, 269082, 269082, 269082, 269082, 269082, 269082, 269082, 269082, 269082, 269082, 269083, 269083, 269083, 269083, 269083, 269083, 269083, 269083, 269083, 269083, 269083, 269083, 269083, 269083, 269083, 269083, 269083, 269083, 269083, 269083, 269083, 269083, 269083}

    {482717, 482717, 482717, 482717, 482717, 482717, 482717, 482717, 482717, 482717, 482717, 482717, 482717, 482717, 482717, 482717, 482717, 482717, 482717, 482717, 482717, 482717, 482717, 482718, 482718, 482718, 482718, 482718, 482718, 482718, 482718, 482718, 482718, 482718, 482718, 482718, 482718, 482718, 482718, 482718, 482718, 482718, 482718, 482718, 482718, 482718, 482718, 482718, 482718}

    Returns: {269082, 482718 }

  44. {464768, 464768, 464768, 464768, 464768, 464768, 464768, 464768, 464768, 464768, 464768, 464768, 464768, 464768, 464768, 464768, 464768, 464768, 464768, 464768, 464768, 464768, 464768, 464769, 464769, 464769, 464769, 464769, 464769, 464769, 464769, 464769, 464769, 464769, 464769, 464769, 464769, 464769, 464769, 464769, 464769, 464769, 464769, 464769, 464769, 464769, 464769, 464769, 464769}

    {-33044, -33044, -33044, -33044, -33044, -33044, -33044, -33044, -33044, -33044, -33044, -33044, -33044, -33044, -33044, -33044, -33044, -33044, -33044, -33044, -33044, -33044, -33044, -33044, -33043, -33043, -33043, -33043, -33043, -33043, -33043, -33043, -33043, -33043, -33043, -33043, -33043, -33043, -33043, -33043, -33043, -33043, -33043, -33043, -33043, -33043, -33043, -33043, -33043}

    Returns: {464769, -33043 }

  45. {275159, 275159, 275159, 275159, 275159, 275159, 275159, 275159, 275159, 275159, 275159, 275159, 275159, 275159, 275159, 275159, 275159, 275159, 275159, 275159, 275159, 275159, 275159, 275159, 275160, 275160, 275160, 275160, 275160, 275160, 275160, 275160, 275160, 275160, 275160, 275160, 275160, 275160, 275160, 275160, 275160, 275160, 275160, 275160, 275160, 275160, 275160, 275160, 275160}

    {-148641, -148641, -148641, -148641, -148641, -148641, -148641, -148641, -148641, -148641, -148641, -148641, -148641, -148641, -148641, -148641, -148641, -148641, -148641, -148641, -148641, -148641, -148641, -148641, -148640, -148640, -148640, -148640, -148640, -148640, -148640, -148640, -148640, -148640, -148640, -148640, -148640, -148640, -148640, -148640, -148640, -148640, -148640, -148640, -148640, -148640, -148640, -148640, -148640}

    Returns: {275160, -148640 }

  46. {-163352, -163352, -163352, -163352, -163352, -163352, -163352, -163352, -163352, -163352, -163352, -163352, -163352, -163352, -163352, -163352, -163352, -163352, -163352, -163352, -163352, -163352, -163352, -163352, -163352, -163351, -163351, -163351, -163351, -163351, -163351, -163351, -163351, -163351, -163351, -163351, -163351, -163351, -163351, -163351, -163351, -163351, -163351, -163351, -163351, -163351, -163351, -163351, -163351}

    {410112, 410112, 410112, 410112, 410112, 410112, 410112, 410112, 410112, 410112, 410112, 410112, 410112, 410112, 410112, 410112, 410112, 410112, 410112, 410112, 410112, 410112, 410112, 410112, 410113, 410113, 410113, 410113, 410113, 410113, 410113, 410113, 410113, 410113, 410113, 410113, 410113, 410113, 410113, 410113, 410113, 410113, 410113, 410113, 410113, 410113, 410113, 410113, 410113}

    Returns: {-163352, 410113 }

  47. {292798, 292798, 292798, 292798, 292798, 292798, 292798, 292798, 292798, 292798, 292798, 292798, 292798, 292798, 292798, 292798, 292798, 292798, 292798, 292798, 292798, 292798, 292798, 292798, 292798, 292798, 292799, 292799, 292799, 292799, 292799, 292799, 292799, 292799, 292799, 292799, 292799, 292799, 292799, 292799, 292799, 292799, 292799, 292799, 292799, 292799, 292799, 292799, 292799}

    {-114560, -114560, -114560, -114560, -114560, -114560, -114560, -114560, -114560, -114560, -114560, -114560, -114560, -114560, -114560, -114560, -114560, -114560, -114560, -114560, -114560, -114560, -114560, -114560, -114559, -114559, -114559, -114559, -114559, -114559, -114559, -114559, -114559, -114559, -114559, -114559, -114559, -114559, -114559, -114559, -114559, -114559, -114559, -114559, -114559, -114559, -114559, -114559, -114559}

    Returns: {292798, -114559 }

  48. {270714, 270714, 270714, 270714, 270714, 270714, 270714, 270714, 270714, 270714, 270714, 270714, 270714, 270714, 270714, 270714, 270714, 270714, 270714, 270714, 270714, 270714, 270714, 270715, 270715, 270715, 270715, 270715, 270715, 270715, 270715, 270715, 270715, 270715, 270715, 270715, 270715, 270715, 270715, 270715, 270715, 270715, 270715, 270715, 270715, 270715, 270715, 270715, 270715}

    {393271, 393271, 393271, 393271, 393271, 393271, 393271, 393271, 393271, 393271, 393271, 393271, 393271, 393271, 393271, 393271, 393271, 393271, 393271, 393271, 393271, 393271, 393271, 393271, 393271, 393272, 393272, 393272, 393272, 393272, 393272, 393272, 393272, 393272, 393272, 393272, 393272, 393272, 393272, 393272, 393272, 393272, 393272, 393272, 393272, 393272, 393272, 393272, 393272}

    Returns: {270715, 393271 }

  49. {200916, 200916, 200916, 200916, 200916, 200916, 200916, 200916, 200916, 200916, 200916, 200916, 200916, 200916, 200916, 200916, 200916, 200916, 200916, 200916, 200916, 200916, 200916, 200916, 200917, 200917, 200917, 200917, 200917, 200917, 200917, 200917, 200917, 200917, 200917, 200917, 200917, 200917, 200917, 200917, 200917, 200917, 200917, 200917, 200917, 200917, 200917, 200917, 200917}

    {28581, 28581, 28581, 28581, 28581, 28581, 28581, 28581, 28581, 28581, 28581, 28581, 28581, 28581, 28581, 28581, 28581, 28581, 28581, 28581, 28581, 28581, 28581, 28581, 28581, 28582, 28582, 28582, 28582, 28582, 28582, 28582, 28582, 28582, 28582, 28582, 28582, 28582, 28582, 28582, 28582, 28582, 28582, 28582, 28582, 28582, 28582, 28582, 28582}

    Returns: {200917, 28581 }

  50. {285253, 285253, 285253, 285253, 285253, 285253, 285253, 285253, 285253, 285253, 285253, 285253, 285253, 285253, 285253, 285253, 285253, 285253, 285253, 285253, 285253, 285253, 285253, 285253, 285253, 285254, 285254, 285254, 285254, 285254, 285254, 285254, 285254, 285254, 285254, 285254, 285254, 285254, 285254, 285254, 285254, 285254, 285254, 285254, 285254, 285254, 285254, 285254, 285254}

    {98280, 98280, 98280, 98280, 98280, 98280, 98280, 98280, 98280, 98280, 98280, 98280, 98280, 98280, 98280, 98280, 98280, 98280, 98280, 98280, 98280, 98280, 98280, 98280, 98280, 98281, 98281, 98281, 98281, 98281, 98281, 98281, 98281, 98281, 98281, 98281, 98281, 98281, 98281, 98281, 98281, 98281, 98281, 98281, 98281, 98281, 98281, 98281, 98281}

    Returns: {285253, 98280 }

  51. {291465, 291465, 291465, 291465, 291465, 291465, 291465, 291465, 291465, 291465, 291465, 291465, 291465, 291465, 291465, 291465, 291465, 291465, 291465, 291465, 291465, 291465, 291465, 291465, 291465, 291465, 291466, 291466, 291466, 291466, 291466, 291466, 291466, 291466, 291466, 291466, 291466, 291466, 291466, 291466, 291466, 291466, 291466, 291466, 291466, 291466, 291466, 291466, 291466}

    {361119, 361119, 361119, 361119, 361119, 361119, 361119, 361119, 361119, 361119, 361119, 361119, 361119, 361119, 361119, 361119, 361119, 361119, 361119, 361119, 361119, 361119, 361119, 361119, 361119, 361120, 361120, 361120, 361120, 361120, 361120, 361120, 361120, 361120, 361120, 361120, 361120, 361120, 361120, 361120, 361120, 361120, 361120, 361120, 361120, 361120, 361120, 361120, 361120}

    Returns: {291465, 361119 }

  52. {95293, 95293, 95293, 95293, 95293, 95293, 95293, 95293, 95293, 95293, 95293, 95293, 95293, 95293, 95293, 95293, 95293, 95293, 95293, 95293, 95293, 95293, 95293, 95294, 95294, 95294, 95294, 95294, 95294, 95294, 95294, 95294, 95294, 95294, 95294, 95294, 95294, 95294, 95294, 95294, 95294, 95294, 95294, 95294, 95294, 95294, 95294, 95294, 95294}

    {-23151, -23151, -23151, -23151, -23151, -23151, -23151, -23151, -23151, -23151, -23151, -23151, -23151, -23151, -23151, -23151, -23151, -23151, -23151, -23151, -23151, -23151, -23151, -23151, -23151, -23151, -23150, -23150, -23150, -23150, -23150, -23150, -23150, -23150, -23150, -23150, -23150, -23150, -23150, -23150, -23150, -23150, -23150, -23150, -23150, -23150, -23150, -23150, -23150}

    Returns: {95294, -23151 }

  53. {286561, 286561, 286561, 286561, 286561, 286561, 286561, 286561, 286561, 286561, 286561, 286561, 286561, 286561, 286561, 286561, 286561, 286561, 286561, 286561, 286561, 286561, 286561, 286561, 286562, 286562, 286562, 286562, 286562, 286562, 286562, 286562, 286562, 286562, 286562, 286562, 286562, 286562, 286562, 286562, 286562, 286562, 286562, 286562, 286562, 286562, 286562, 286562, 286562}

    {246670, 246670, 246670, 246670, 246670, 246670, 246670, 246670, 246670, 246670, 246670, 246670, 246670, 246670, 246670, 246670, 246670, 246670, 246670, 246670, 246670, 246670, 246670, 246670, 246670, 246670, 246671, 246671, 246671, 246671, 246671, 246671, 246671, 246671, 246671, 246671, 246671, 246671, 246671, 246671, 246671, 246671, 246671, 246671, 246671, 246671, 246671, 246671, 246671}

    Returns: {286562, 246670 }

  54. {-127125, -127125, -127125, -127125, -127125, -127125, -127125, -127125, -127125, -127125, -127125, -127125, -127125, -127125, -127125, -127125, -127125, -127125, -127125, -127125, -127125, -127125, -127125, -127125, -127125, -127124, -127124, -127124, -127124, -127124, -127124, -127124, -127124, -127124, -127124, -127124, -127124, -127124, -127124, -127124, -127124, -127124, -127124, -127124, -127124, -127124, -127124, -127124, -127124}

    {275436, 275436, 275436, 275436, 275436, 275436, 275436, 275436, 275436, 275436, 275436, 275436, 275436, 275436, 275436, 275436, 275436, 275436, 275436, 275436, 275436, 275436, 275436, 275436, 275436, 275436, 275437, 275437, 275437, 275437, 275437, 275437, 275437, 275437, 275437, 275437, 275437, 275437, 275437, 275437, 275437, 275437, 275437, 275437, 275437, 275437, 275437, 275437, 275437}

    Returns: {-127125, 275436 }

  55. {379458, 379458, 379458, 379458, 379458, 379458, 379458, 379458, 379458, 379458, 379458, 379458, 379458, 379458, 379458, 379458, 379458, 379458, 379458, 379458, 379458, 379458, 379458, 379458, 379458, 379458, 379459, 379459, 379459, 379459, 379459, 379459, 379459, 379459, 379459, 379459, 379459, 379459, 379459, 379459, 379459, 379459, 379459, 379459, 379459, 379459, 379459, 379459, 379459}

    {-198145, -198145, -198145, -198145, -198145, -198145, -198145, -198145, -198145, -198145, -198145, -198145, -198145, -198145, -198145, -198145, -198145, -198145, -198145, -198145, -198145, -198145, -198145, -198145, -198145, -198145, -198144, -198144, -198144, -198144, -198144, -198144, -198144, -198144, -198144, -198144, -198144, -198144, -198144, -198144, -198144, -198144, -198144, -198144, -198144, -198144, -198144, -198144, -198144}

    Returns: {379458, -198145 }

  56. {750, -500, -250 }

    {-1000, 500, 500 }

    Returns: {0, 0 }

  57. {123456, -987654, 97531, -86420 }

    {14703, 25814, 36924, -47036 }

    Returns: {-213272, 7601 }

  58. {123456, -987654, 97351, -86240 }

    {14703, 25814, 36924, -470 }

    Returns: {-213272, 19243 }

  59. {0, 0, 0 }

    {1, 2, 2 }

    Returns: {0, 2 }

  60. {1, 2, 2 }

    {0, 0, 0 }

    Returns: {2, 0 }

  61. {123456, -987654, 97531, -86420, 654564, 45645, 46464, -984506, 564566 }

    {14703, 25814, 36924, -47036, 654564, 124, 54564, -845645, 751512 }

    Returns: {-58484, 71725 }

  62. {1, 3, 4 }

    {0, 0, 0 }

    Returns: {3, 0 }

  63. {0, 5, 5, 6, 8, 8 }

    {0, 0, 0, 0, 0, 0 }

    Returns: {5, 0 }

  64. {499, 2344, 235236, -34633, -345345, 345, 887345 }

    {35434, 34536, 78068, -284778, 468978, 7675, -45345 }

    Returns: {106542, 42081 }

  65. {100, -100, 14656, 43543, 435435, 4545, 345345, 435345, 345435, 23, 23, 234, 3423, 234, 234, 4, 23, 53454, 35, 5, 3, 5, 43, 5, 3, 5, 3, 3, 534534, 43, 3, 43, 3454, 435, 457657, 657, 657, 345, 345, 345, 345, 346, 345, 345, 345, 567, 678, 0 }

    {456, 56, 56, 6, 56, 5, 6546, 565, 5656, 5656, 5656, 454, 2323, 2323, 232, 989, 989, 8989, 87787, 787, 787, 5656, 545, 3434, 4545, 676, 878, 5656, 4545, 3434, 454, 5656, 687, 98, 54, 454, 565, 65, 5465, 454, 76, 78, 676, 454, 343, 435, 54, 4545 }

    Returns: {55907, 3757 }

  66. {100, 101, 104 }

    {100, 101, 104 }

    Returns: {102, 102 }

  67. {-1000000, -104320, -1000000, -1000000, -1000000, -1000000, -1000000, -1000000, -100123, -1000000, -1000000, -1000000, -1000000, -1000000, -107650, -1000000, -1000000, -1000000, -1000000, -1000000, -1000000, -1000000, -1000000, -1000000, -100876, -1000000, -1000000, -1000000, -1000000, -1000000, -105432, -1000000, -1000000, -1000000, -1000000, -1000000, -1000000, -1000000, -1000000, -105432, -1000000, -1000000, -1000000, -1000000, -1000000, -1000000, -1000000, -1000, -1000000, -1000000 }

    {1000000, 1000000, 1000000, 1000000, 1000000, 100052, 1000000, 1000000, 1000000, 1000000, 1000000, 1000000, 1000000, 1000000, 122220, 1000000, 1000000, 1000000, 100004, 1000000, 1000000, 1000000, 1000000, 1000000, 1000000, 1000000, 1000000, 1000000, 1000000, 1000000, 100432, 1000000, 1000000, 1000000, 1000000, 1000000, 1000000, 1000000, 1000000, 1432, 1000000, 1000000, 1000, 1000000, 1000000, 1000000, 100, 1000000, 432000, 1000000 }

    Returns: {-872497, 857145 }

  68. {-1, -1, 0 }

    {0, 0, 0 }

    Returns: {-1, 0 }


This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2024, TopCoder, Inc. All rights reserved.
This problem was used for: