Statistics

Problem Statement for "PlaneGame"

Problem Statement

Jerry is playing a rather plain computer game. The game is played in the 2D Cartesian plane. At the beginning of the game there are some points in the plane. You are given their coordinates in the int[]s x and y. That is, for each valid i there is a point at (x[i], y[i]).

The objective of the game is to make a single shot that will eliminate as many of these points as possible. When Jerry takes the shot, it will eliminate all points that (at that moment) lie on the x-axis and also all points that lie on the y-axis.

Before Jerry takes the shot, he may perform a sequence of zero or more actions. Each action can be of either of the following two types:

  • He may translate all points by any vector (the same for all points). In other words, he may shift all points in the same direction by the same distance.
  • He may rotate all points around the origin by any angle (the same for all points).

Note that it is possible that after an action some points will have non-integer coordinates.

Find and return the maximum number of points Jerry can eliminate in one shot.

Definition

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

Constraints

  • x will contain between 1 and 50 elements, inclusive.
  • y will contain the same number of elements as x.
  • Each element of x and y will be between -1,000,000 and 1,000,000, inclusive.
  • No two points will have the same coordinates.

Examples

  1. {0, 5}

    {0, 5}

    Returns: 2

    At the beginning of the game there are two points: one at (0, 0) and the other at (5, 5). Jerry can shift both points by 5 in the negative y direction. This will move the points to (0, -5) and (5, 0). Then Jerry can take the shot and eliminate both points. Therefore, the answer is 2.

  2. {0, -1, 1, 1, -1}

    {0, -1, -1, 1, 1}

    Returns: 5

  3. {0, 0, 0, 1, -1}

    {0, 1, -1, 0, 0}

    Returns: 5

  4. {0, -3, 3, 3, -3, 0, 0, 3, -3}

    {0, -3, -3, 3, 3, 3, -3, 0, 0}

    Returns: 5

  5. {0}

    {0}

    Returns: 1

  6. {-1000000, -1, 999998, 1, -1001, 1000000, -999999, 999999, 0, 0}

    {1000000, 1, 1000000, -1, -999, 1000000, 0, 0, -999999, 999999}

    Returns: 5

  7. {9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9}

    {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49}

    Returns: 50

  8. {0,-1,-2,-3,-4,-5,-6,-7,-8,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,-20,-21,-22,-23,-24,-25,-26,-27,-28,-29,-30,-31,-32,-33,-34,-35,-36,-37,-38,-39,-40,-41,-42,-43,-44,-45,-46,-47,-48,-49}

    {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}

    Returns: 50

  9. {-149850,-148851,-147852,-146853,-145854,-144855,-143856,-142857,-141858,-140859,-139860,-138861,-137862,-136863,-135864,-134865,-133866,-132867,-131868,-130869,-129870,-128871,-127872,-126873,-125874,-124875,-123876,-122877,-121878,-120879,-119880,-118881,-117882,-116883,-115884,-114885,-113886,-112887,-111888,-110889,-109890,-108891,-107892,-106893,-105894,-104895,-103896,-102897,-101898,-100899}

    {-149850,-148851,-147852,-146853,-145854,-144855,-143856,-142857,-141858,-140859,-139860,-138861,-137862,-136863,-135864,-134865,-133866,-132867,-131868,-130869,-129870,-128871,-127872,-126873,-125874,-124875,-123876,-122877,-121878,-120879,-119880,-118881,-117882,-116883,-115884,-114885,-113886,-112887,-111888,-110889,-109890,-108891,-107892,-106893,-105894,-104895,-103896,-102897,-101898,-100899}

    Returns: 50

  10. {0,1,0,2,0,3,0,4,0,5,0,6,0,7,0,8,0,9,0,10,0,11,0,12,0,13,0,14,0,15,0,16,0,17,0,18,0,19,0,20,0,21,0,22,0,23,0,24,0,25}

    {0,0,1,0,2,0,3,0,4,0,5,0,6,0,7,0,8,0,9,0,10,0,11,0,12,0,13,0,14,0,15,0,16,0,17,0,18,0,19,0,20,0,21,0,22,0,23,0,24,0}

    Returns: 50

  11. {-1000000,1000000,-1000000,1000000,559207,551955,432768,-290103,-166745,-567532,-572722,-845187,47839,998769,494597,119717,-139142,620183,-403443,874225,-644444,-995886,-305110,-257754,-264533,-70033,984175,-835702,229443,-636536,-451901,-903998,125168,-353969,-701730,-893016,318057,-892351,152945,39886,-889372,-2773,-553253,-88633,-65488,764260,721269,-949974,-368557,-80176}

    {999999,1000000,-999999,-1000000,15520,655814,332224,-668340,-697479,674804,-764397,-266297,-471222,-118868,-134201,643745,100215,-373448,690941,477028,-308064,-200567,-9706,-550271,19852,-317050,-437959,-53049,-829572,816570,-395103,587437,284732,322344,213886,-313419,439278,-695295,-745400,-942659,898260,-369283,-525997,-469593,335157,-672090,-718547,-34248,923139,466116}

    Returns: 3

  12. {999999,1000000,999999,1000000,65036,207851,-439449,-526267,517862,-759802,-74761,-443510,-149701,-256051,-635429,-983849,-414798,-657560,-691972,-703857,571972,-132489,-573082,516200,868738,-971953,-531023,-800508,-647806,255469,-467030,778590,628638,770517,551169,-256426,-444250,962165,-771681,-151390,-708579,590239,868014,500192,-580825,200983,-182339,-679940,-66565,323690}

    {1000000,999999,-1000000,-999999,-713244,-385276,-917381,-933583,288211,-868574,61410,-883034,723783,-232927,406208,-747213,549535,-22482,-363640,-558665,720795,-977067,772123,-643427,-373710,287323,-246538,283847,-262447,759815,642494,51349,-873726,-545334,-940003,744793,-24879,-118814,-173895,570266,-650833,897327,412702,416931,-519353,278363,-691818,-850804,662040,-704452}

    Returns: 4

  13. {-6993,-6993,-6660,-6660,-6327,-6327,-5994,-5994,-5661,-5661,-5328,-5328,-4995,-4995,-4662,-4662,-4329,-4329,-3996,-3996,-3663,-3663,-3330,-3330,-2997,-2997,-2664,-2664,-2331,-2331,-1998,-1998,-1665,-1665,-1332,-1332,-999,-999,-666,-666,-333,-333,0,0,333,333,666,666,999,999}

    {-11322,37962,-10989,37629,-10656,37296,-10323,36963,-9990,36630,-9657,36297,-9324,35964,-8991,35631,-8658,35298,-8325,34965,-7992,34632,-7659,34299,-7326,33966,-6993,33633,-6660,33300,-6327,32967,-5994,32634,-5661,32301,-5328,31968,-4995,31635,-4662,31302,-4329,30969,-3996,30636,-3663,30303,-3330,29970}

    Returns: 50

  14. {-6993,-6993,-6660,-6660,-6327,-6327,-5994,-5994,-5661,-5661,-5328,-5328,-4995,-4995,-4662,-4662,-4329,-4329,-3996,-3996,-3663,-3663,-3330,-3330,-2997,-2997,-2664,-2664,-2331,-2331,-1998,-1998,-1665,-1665,-1332,-1332,-999,-999,-666,-666,-333,-333,0,0,333,333,666,666,999,999}

    {-11322,87912,-10989,87579,-10656,87246,-10323,86913,-9990,86580,-9657,86247,-9324,85914,-8991,85581,-8658,85248,-8325,84915,-7992,84582,-7659,84249,-7326,83916,-6993,83583,-6660,83250,-6327,82917,-5994,82584,-5661,82251,-5328,81918,-4995,81585,-4662,81252,-4329,80919,-3996,80586,-3663,80253,-3330,79920}

    Returns: 50

  15. {-48635,-135630,-48498,-135493,-48361,-135356,-48224,-135219,-48087,-135082,-47950,-134945,-47813,-134808,-47676,-134671,-47539,-134534,-47402,-134397,-47265,-134260,-47128,-134123,-46991,-133986,-46854,-133849,-46717,-133712,-46580,-133575,-46443,-133438,-46306,-133301,-46169,-133164,-46032,-133027,-45895,-132890,-45758,-132753,-45621,-132616,-45484,-132479,-45347,-132342}

    {-135630,-28222,-135493,-28359,-135356,-28496,-135219,-28633,-135082,-28770,-134945,-28907,-134808,-29044,-134671,-29181,-134534,-29318,-134397,-29455,-134260,-29592,-134123,-29729,-133986,-29866,-133849,-30003,-133712,-30140,-133575,-30277,-133438,-30414,-133301,-30551,-133164,-30688,-133027,-30825,-132890,-30962,-132753,-31099,-132616,-31236,-132479,-31373,-132342,-31510}

    Returns: 50

  16. {1000000,999999,999998,999997,999996,999995,999994,999993,999992,999991,999990,999989,999988,999987,999986,999985,999984,999983,999982,999981,999980,999979,999978,999977,999976,999975,999974,999973,999972,999971,999970,999969,999968,999967,999966,999965,999964,999963,999962,999961,999960,999959,999958,999957,999956,999955,999954,999953,999952,999951}

    {999999,999998,999997,999996,999995,999994,999993,999992,999991,999990,999989,999988,999987,999986,999985,999984,999983,999982,999981,999980,999979,999978,999977,999976,999975,999974,999973,999972,999971,999970,999969,999968,999967,999966,999965,999964,999963,999962,999961,999960,999959,999958,999957,999956,999955,999954,999953,999952,999951,999950}

    Returns: 50

  17. {0,9788,19509}

    {0,14,30}

    Returns: 3

  18. {0,99,198}

    {0,1,1}

    Returns: 3

  19. {-1000000,0,1000000}

    {-1000000,-999999,-999997}

    Returns: 3

  20. {-1000000,0,1000000}

    {-1000000,-999999,-999998}

    Returns: 3

  21. {-301563,714382,940434,768504,195,959350,13,212532,31412,-893508,-546715,134712,68,5,-517857,374406,560379,150226,39,176,202,-856465,17,483518,4,26,160,181,570660,794784,225,185272,46572,192,-380380,34,25,48,174094,-901951,7,198,564061,-559737,-971731,-465785,67,188,-738639,144167}

    {-416652,972572,-451947,354396,45,-365014,137,291391,-265483,-923344,-719789,125652,82,145,-610115,507468,343284,-374914,111,26,52,376367,133,-551928,146,124,10,31,-574912,264828,75,797089,958910,42,-483260,116,125,102,988193,-994605,143,48,208105,-690643,-58337,96189,83,38,884870,-403893}

    Returns: 21

  22. {15080,16965,47879,44863,-75933,-61065,44109,-37701,-16461,-70623,-2124,-28143,17719,-21771,41470,-59472,-56286,44486,32045,11687,-21240,-52569,46748,-6903,-76995,38831,-69561,-11682,-63720,13949,-39825,-531,23374,-58941,-39294,17342,-72216,53157,-30798,55419,11310,1885,-23364,-38232,32422,-22302,10933,38454,-13806,50895}

    {21240,23895,67437,63189,53911,43355,62127,26767,11687,50141,1508,19981,24957,15457,58410,42224,39962,62658,45135,16461,15080,37323,65844,4901,54665,54693,49387,8294,45240,19647,28275,377,32922,41847,27898,24426,51272,74871,21866,78057,15930,2655,16588,27144,45666,15834,15399,54162,9802,71685}

    Returns: 50

  23. {34816,93184,67584,17408,18432,-6144,33792,-97280,79206,81048,94208,-78848,90258,65536,35919,53418,-67584,38682,71838,74601,81969,28672,13312,49734,-66560,-88064,17499,-34816,-87040,42366,921,85653,-15360,-62464,-49152,57102,54339,47104,-99328,21183,-30720,20262,-22528,64470,25788,41984,-58368,-31744,-54272,56181}

    {-31314,-83811,-60786,-15657,-16578,5526,-30393,87495,88064,90112,-84732,70917,100352,-58944,39936,59392,60786,43008,79872,82944,91136,-25788,-11973,55296,59865,79206,19456,31314,78285,47104,1024,95232,13815,56181,44208,63488,60416,-42366,89337,23552,27630,22528,20262,71680,28672,-37761,52497,28551,48813,62464}

    Returns: 50

  24. {734,-411,-927,-752,-207,-424,-296,-295,790,-158,963,309,-349,39,-543,-899,466,-875,18,417,558,-142,-499,-809,529,964,691,280,-275,98,-424,-350,832,-879,711,98,-867,-1,904,-426,-320,3,373,286,868,-184,-647,-39,892,841}

    {-398,-726,-623,925,-755,-60,441,83,442,-72,-325,-858,-59,873,-171,471,-464,-727,567,120,524,600,819,827,838,834,-371,778,-928,187,801,-77,-881,85,157,-654,560,-579,63,-212,-300,831,358,289,-960,-312,707,620,277,-260}

    Returns: 4

  25. {376571,469396,-171371,50871,58054,257976,17146,680286,-690072,985586,-271962,711527,-762573,-648090,473298,-263189,-226191,-359922,-996574,76997,-603805,96034,557861,-351436,869820,845745,173195,962351,-266215,-931966,753178,-193492,-862745,102345,-87605,369935,442019,-568981,594760,486945,468874,368047,-370469,116201,178732,791899,959481,395402,-866481,566642}

    {381782,84560,62369,-589150,-185644,-410307,713166,-501767,914280,632506,-577583,914164,-990978,-364687,-92035,-217802,364689,-610377,-851474,942210,836623,809524,187358,-191873,347848,-377626,675266,962299,806717,-645310,-825301,929197,459490,395290,754410,838639,-531215,-616730,913271,-600739,-630057,-70709,341571,-393566,-858350,659473,752916,522556,-821,972807}

    Returns: 3

  26. {261874,-745377,-962532,-749535,-362291,542305,-757637,-879325,363719,-397135,-417119,-857883,-397832,650578,-560822,-13545,188611,149964,367438,-370396,-401979,-958200,-302726,989456,678784,749497,-456863,-426793,-943455,378126,714899,324680,-762088,40025,779281,-583833,-79486,-786028,-349884,497575,504483,32764,485952,33841,531194,-620723,783465,90382,-166927,207971}

    {691496,-346391,988915,-94582,991072,-680913,-920987,481008,199316,680438,-853143,606130,382832,-934292,-533881,-408239,465180,-141409,-146900,876989,345528,-833132,-352307,636633,-724134,-672674,11418,-641172,-91865,967396,179022,-655177,147817,-860117,-260114,36893,13565,586302,-272994,446374,-113866,-941025,725589,30813,-418852,984728,-981301,-243960,-596662,189216}

    Returns: 3

  27. {-191296,572473,283143,-430509,728323,700181,-752311,912120,-552253,-643154,939715,-745742,346502,127932,-570770,-174898,428487,372933,-801497,-997035,-945652,714809,897393,-18927,690356,936117,-712333,-678367,424271,-404689,270984,-162297,-754039,297903,694928,-436653,-180076,98669,696778,-495052,213556,-546629,611244,189050,969893,719906,849951,-551953,-372468,-767388}

    {428529,170732,-13463,-7958,190683,-335754,-453780,112721,-900120,532238,-368232,-351572,832853,-667095,-157594,48852,-303102,873219,-969614,-295241,533709,279805,101628,-141083,-904513,557298,-121198,316877,-557254,-627902,598974,764784,-644471,980899,-783097,-166844,-241471,483942,430325,663797,-431426,-986614,-200452,-864295,-211791,-930468,642088,870098,-761259,653284}

    Returns: 3

  28. {8568,-2529,5435,-6838,8788,-7729,4623,-6656,-1717,8438,-4677,-3084,-4104,-9714,-7879,3177,2442,-3755,-1902,-4904,-63,1529,9252,1425,1736,-6178,2188,-8668,-9927,-4585,-3034,9825,-6404,3018,9032,8377,-2951,9967,9943,-8475,4601,-6309,7783,5687,-9578,2749,8806,-9788,-683,1613}

    {6212,-5950,7911,-1836,-1907,2699,-313,2138,1057,9908,1903,-6102,681,-7729,-2276,-1948,-2923,7149,3644,-3297,2131,9175,-1218,9148,-7615,-3615,-5342,-454,9447,-5317,1155,-1206,-7946,-5869,-1191,-3749,94,-5030,5051,6664,-1827,-865,-6884,3056,-5365,-5891,4327,5009,4389,-6692}

    Returns: 3

  29. {98,43,1,59,-76,-7,55,2,-8,78,65,55,33,34,20,47,91,-54,-43,-50,48,60,69,-1,-77,-38,-97,-12,-31,-71,-20,-5,-41,-86,-93,35,80,86,-36,27,42,-71,-44,-25,-1,-77,90,54,-30,-8}

    {64,27,-6,-80,45,84,-18,57,-26,20,-23,16,76,60,-50,90,-91,-74,-83,26,-8,-47,-98,-31,51,-39,99,-55,41,95,18,-89,35,-12,-53,-95,47,-80,33,-59,-59,64,100,-26,2,38,21,19,-5,55}

    Returns: 5

  30. {0,77,81,63,12,38,19,87,65,5,19,-87,12,37,-69,-76,-22,-37,60,-59,81,10,86,-79,67,9,-65,55,62,38,-29,64,21,-22,71,-26,83,72,32,-11,-27,-56,14,-12,-90,-99,62,88,-78,19}

    {67,81,89,64,-78,65,99,95,25,51,-44,34,93,-85,-87,-14,14,36,-54,67,71,-58,-75,71,9,69,16,83,83,6,-69,-7,-56,-24,62,-67,-42,51,99,-9,59,0,-18,38,-77,83,74,38,72,1}

    Returns: 6

  31. {-191,176,266,-132,8,-107,234,245,127,275,-72,-127,-119,92,-196,15,-224,149,8,-266,71,88,97,115,69,-67,-66,-188,8,-227,209,-65,105,-172,-224,279,219,-65,-168,-25,-198,97,246,35,158,48,-206,294,27,236}

    {-283,147,219,252,-12,-39,21,186,-47,-174,-59,-47,-88,187,256,-67,-240,-124,-269,-130,59,-254,-223,43,-203,-219,139,-284,-109,289,-195,-165,48,-102,75,204,-118,151,-166,-193,233,140,-269,236,24,129,-292,-183,99,-152}

    Returns: 5

  32. {787874,-273806,109056,-376472,-443730,-169328,-223744,319364,904010,-390650,-172865,-372985,-199823,-277260,19032,-36850,445346,449612,-554520,155146,756238,-203748,-368625,296754,322980,627344,522894,969914,-22364,303725,9516,-56552,668740,-720892,-98128,-49064,-311352,455812,-177230,-378010,50380,129740,-143294,271522,309302,-622704,409293,-304238,505174,145134}

    {531450,-871296,-448945,292267,356527,-183392,-370350,-66152,-64584,252437,194376,-305790,46933,44388,940308,274756,-480413,297867,88776,-58812,411194,372149,247494,-457407,302606,-765034,-33380,454212,359482,81106,470154,38120,778198,330628,-50488,-25244,108921,792950,273600,562268,-305578,491034,-899734,-178128,217737,217842,317900,108367,-341172,-740718}

    Returns: 3

  33. {-1000000,-999980,-999960,-999940,-999920,-999900,-999880,-999860,-999840,-999820,-999800,-999780,-999760,-999740,-999720,-999700,-999680,-999660,-999640,-999620,-999600,-999580,-999560,-999540,-999520,-999500,-999480,-999460,-999440,-999420,-999400,-999380,-999360,-999340,-999320,-999300,-999280,-999260,-999240,-999220,-999200,-999180,-999160,-999140,-999120,-999100,-999080,-999060,-999040,-999020}

    {-1000000,-999980,-999920,-999820,-999680,-999500,-999280,-999020,-998720,-998380,-998000,-997580,-997120,-996620,-996080,-995500,-994880,-994220,-993520,-992780,-992000,-991180,-990320,-989420,-988480,-987500,-986480,-985420,-984320,-983180,-982000,-980780,-979520,-978220,-976880,-975500,-974080,-972620,-971120,-969580,-968000,-966380,-964720,-963020,-961280,-959500,-957680,-955820,-953920,-951980}

    Returns: 3

  34. {-1000000, -1, 999998, 1, -1001, 1000000, -999999, 999999, 0, 0 }

    {1000000, 1, 1000000, -1, -999, 1000000, 0, 0, -999999, 999999 }

    Returns: 5

  35. {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }

    {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }

    Returns: 13

  36. {0, -3, 3, 3, -3, 0, 0, 3, -3 }

    {0, -3, -3, 3, 3, 3, -3, 0, 0 }

    Returns: 5

  37. {1, 2, 3, 4 }

    {1, 2, 3, 4 }

    Returns: 4

  38. {35, 18, -44, -46, -49, -22, 34, 4, 30, -13, 24, -17, -43, 12, 0, -40, 34, 15, -14, 19, -9, 26, -10, 3, -4, -6, -27, -44, -31, -29, -33, 24, 48, -6, -30, 22, 35, 28, 41, 42, 11, -50, 18, -18, -43, 11, -31, 1, -31, -30 }

    {8, 1, 11, -45, -46, 38, 49, -45, -8, -26, -29, -6, 35, -49, 9, -44, 43, -24, 1, -27, 25, -28, -8, -13, -39, 2, 3, 26, -22, -45, -33, 37, -13, -10, -38, 23, 13, 0, 22, -42, -37, -38, 7, -28, -40, -3, -14, 13, 34, 17 }

    Returns: 6

  39. {0, -1, 1, 1, -1 }

    {0, -1, -1, 1, 1 }

    Returns: 5

  40. {1, 2, 2, 1, 3, 2, 4, 5 }

    {1, 2, 1, 2, 3, 4, 2, 1 }

    Returns: 6

  41. {3, 3 }

    {3, -3 }

    Returns: 2

  42. {1, 2 }

    {2, 3 }

    Returns: 2

  43. {0, 0, 0, 1, -1 }

    {0, 1, -1, 0, 0 }

    Returns: 5

  44. {-1000000, -1, 999998, 1, 1, 2, 3, 4, 5, 6 }

    {1000000, 1, 1000000, -1, 1, 2, 3, 4, 5, 6 }

    Returns: 9

  45. {-1000000, -1, 999997, 1, -1001, 1000000, -999999, 999999, 0, 0 }

    {1000000, 1, 999997, -1, -999, 1000000, 0, 0, -999999, 999999 }

    Returns: 5

  46. {5, 8, 9, 1000, 754, 123, 256, 148, 36, 254, -12, -18, -254, -36, -1800 }

    {0, 0, -12, 1, 2, 3, 4, 5, -810, -1, 2541, -2, 658, -952, -12000 }

    Returns: 3

  47. {0, 0, 0, 1, 1, 1, -1, -1, -1, 2, 4, 6, 8, 10, 12, 14, 16 }

    {-1, 0, 1, -1, 0, 1, -1, 0, 1, 1, 2, 3, 4, 5, 6, 7, 8 }

    Returns: 11

  48. {-3, 2, -1, 1 }

    {0, 1, 3, 6 }

    Returns: 4

  49. {0, 2, 3, 5 }

    {2, 4, 0, 2 }

    Returns: 3

  50. {0, 0, 1, -1 }

    {1, -1, 0, 0 }

    Returns: 4

  51. {0 }

    {0 }

    Returns: 1

  52. {-1, 1 }

    {2, 2 }

    Returns: 2

  53. {0, 0, 1000000, -1000000 }

    {0, 1000000, 1, 0 }

    Returns: 3

  54. {0, 2, 2, 3, 3, 5 }

    {2, 4, 5, -1, 0, 2 }

    Returns: 4

  55. {-1, 0, 4 }

    {2, 0, 10000 }

    Returns: 3

  56. {-1000000, -1, 999998, 1, -1001, 1000000, -999999, 999999, 0, 0 }

    {999999, 1, 1000000, -1, -999, 1000000, 0, 0, -999999, 999999 }

    Returns: 5

  57. {0, 10, 5 }

    {0, 0, 1 }

    Returns: 3

  58. {1, -1, 1, -1 }

    {-1, -1, 1, 1 }

    Returns: 4

  59. {1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }

    {1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }

    Returns: 10

  60. {-1000000, 0, 1000000, 0, 1000000 }

    {-1000000, 0, 0, 1000000, 1000000 }

    Returns: 5

  61. {126, 119, 126, 120, 138, 124, 122, 124, 122, 111 }

    {-717, -718, -725, -725, -701, -720, -722, -722, -720, -712 }

    Returns: 5

  62. {-1, -1, -2, -2 }

    {2, 1, 2, 1 }

    Returns: 4

  63. {1, 2, 2, 100 }

    {2, 5, 100, 1000000 }

    Returns: 3

  64. {-1, 1, 1, -1 }

    {-1, -1, 1, 1 }

    Returns: 4


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: