Statistics

Problem Statement for "SoManyRectangles"

Problem Statement

Several rectangles are on the plane, some possibly overlapping others. The rectangles are described in ints x1, y1, x2 and y2. Rectangle i has it's lower-left corner (x1[i], y1[i]), and upper-right corner (x2[i], y2[i]).

Two or more rectangles overlap if they have a common area. Meeting along an edge or a corner only is not an overlap. Return the largest number of rectangles that overlap in a single location.

Definition

Class:
SoManyRectangles
Method:
maxOverlap
Parameters:
int[], int[], int[], int[]
Returns:
int
Method signature:
int maxOverlap(int[] x1, int[] y1, int[] x2, int[] y2)
(be sure your method is public)

Notes

  • Multiple rectangles that share a non-zero common area are considered to be overlapping. As an example, if A overlaps with B and B overlaps with C, but A does not overlap with C, then the answer is 2.

Constraints

  • x1 will contain between 1 and 50 elements, inclusive.
  • x1, y1, x2, and y2 will contain the same number of elements.
  • x1[i] will be less than x2[i], for all valid i.
  • y1[i] will be less than y2[i], for all valid i.
  • All elements of x1, y1, x2 and y2 will be between -10^9 and 10^9, inclusive.

Examples

  1. {0, 50}

    {0, 50}

    {100, 60}

    {100, 60}

    Returns: 2

    There are two rectangles here: (0,0)-(100,100) and (50,50)-(60,60) The second rectangle completely overlaps the first.

  2. {0, 90}

    {0, 90}

    {100, 200}

    {100, 200}

    Returns: 2

    The two rectangles still overlap. It is not necessary for any of them to completely overlap.

  3. {0, 100}

    {0, 100}

    {100, 200}

    {100, 200}

    Returns: 1

    Here the two rectangles meet at a corner, but do not actually have an overlap.

  4. {0, 0, 0, 0, 0}

    {0, 0, 0, 0, 0}

    {1, 1, 1, 1, 1}

    {1, 1, 1, 1, 1}

    Returns: 5

    They are small, but all five overlap perfectly.

  5. {0}

    {0}

    {1}

    {1}

    Returns: 1

    There's only one rectangle.

  6. {-834807066,29875148,-221775078,-916258586,-972137791,-987008576,-249836909,-510654168,-729353729,-811492744,-800191941,-956516940,-594890425,-26680512,-987891576,-721140877,-991847415,-137345612,-501409236,-850720808,-821709628,-999608139,-805796473,-474928971,-871318809,-703545039,-917912492,409964733,-988082357,-619103151,-716474457,-70240840,-527606866,-892584194,-817552808,-903156695,83492044,-528737553,-434643610,-74792277,-638395008,-794054902,112631189,-724537763,-676308085,-565077864,-965788299,-745264175,-894861416,-728246289}

    {683529642,506501603,-204628619,-487023590,878316802,-867728262,280078149,-348706874,-483677257,-740879015,-813840755,-117522364,46352601,581483027,-206767852,-561210468,-487732067,-924314858,-945455167,-968048216,572153562,-499587122,-100955087,-745270414,-526590436,-559204674,-908282862,-459355549,214948699,-738596173,-943828139,-131346452,-262739471,-967679438,296976217,-16941024,-810190951,-853424258,344323778,-738828638,-984977289,-964288306,-808137649,-180384539,-605507877,-522972732,-358458398,-103842913,-903692832,-713753310}

    {-822374328,745485592,229990506,-865930874,-102942892,-946319949,912185339,94930647,-550529395,-717477887,-784859591,-755353841,69567539,609396218,259279476,91721246,-987512152,519093804,-433880109,-581183164,632161645,-991365240,-730025398,-396759283,454096393,-610448958,-844278381,902112050,-810357168,673533816,474492307,112587988,488729538,-882438665,-778548396,-780851586,820421407,450928248,-61569503,316354981,-188410300,-513801984,974879187,59662322,635941373,-434644110,-211304730,-171426305,-705539694,-180171651}

    {743311221,876334616,-93673197,-276617111,900580081,-723716586,987638799,-233844914,479520739,-377528564,964957796,695234051,291470296,663543763,-97495696,892005281,565256118,-448732034,229563717,-705447384,743485586,273433739,302946828,576613396,393631157,700928766,-517065346,120823880,802279432,-292598948,-480243835,755730868,438296583,-966528571,700171892,710931312,-526046882,-607401481,437937171,305887005,-935221171,-542660259,-805547731,-70499446,235423063,-129616332,887930524,957605368,247747978,-580000674}

    Returns: 10

  7. {-328069945,67735397,-892657562,-165093050,-559275388,-754006395,325974984,-898364644,-710373715,-959457054,-823050212,-995343144,150393485,-630354810,430905060,-105617510,-624691677,664751278,-609652457,-940422577,-958960106,-826326849,-963375152,-662564893,-873545164,-91341767,-535632001,-121910469,-781317967,339852755,-497618250,-607536380,-998103775,-989417082,-892547865,-639154654,-820199079,-181568237,-889185128,-908386930,-358938084,-752694383,-857467590,534775584,-863558142,224891136,101678051,276831229,-470544526,-820128548}

    {-350274026,-996980611,-941674927,-255473028,-463063318,-998552961,-808644220,-777764638,-209432447,-984137971,-946018977,-592229837,-603942000,-952804175,-573517413,-482002812,-44426697,-962960212,-771257730,14448147,-890718701,-512811576,-40885917,-873643171,-573285127,-929047098,-181865568,-382045777,-733028326,-898417630,-898617272,-606812936,-957158015,-938135465,-127684980,-136208193,-942458695,-739691970,-996143535,-831598725,493013037,-138975813,-927869131,-709507680,-895480314,-851611327,-972166957,-192050434,-826266975,-599903045}

    {626787594,265814464,-81968524,-89838564,-473799417,-629415441,579574372,-784609853,-427529643,-955698432,-799102495,723751864,413113116,-255120871,706605866,-2662229,-502395907,755229439,964655389,-594051330,-794183709,-262632890,-959853203,-394799340,-715714555,25484417,-124000088,667315225,-484713675,476317446,-453151462,-521063907,-552453793,50727891,-620636125,-141324780,-500696520,926942829,393969068,-709485105,745173029,-308736087,-388870761,784568162,-839793503,941204212,222129769,428689682,-341523821,-445820498}

    {34203574,-323760611,441336740,-232923285,794971943,-832458641,-788780545,-634463890,32643904,-717897733,-922174761,-466054021,-227095625,-935314788,-191191720,875118674,17911457,-696517456,562664317,940360753,-848481973,918876240,552601043,-224278454,209097324,-872114369,384070685,-300262213,-368726785,-648945978,676417,-338588825,-928408845,587681550,289170657,288848107,-941698662,-730701635,-689094993,569525757,871267177,856446216,-229151943,-538168170,-503038274,664970212,-924757549,995335976,-648102877,244745850}

    Returns: 11

  8. {-85028107,-865991778,-449147890,-744904785,-886188950,-959856104,-248327979,-699571068,-4164834,-943281507,-856498256,-938317039,-985155942,-743318103,-974645630,-955544830,-808179072,6551320,-937600160,-556965776,-517255738,-992145931,-563005856,378561144,-869058752,-968328067,589550276,34880512,-812283590,23891376,-848640258,-923068022,-924319034,-698413657,389978978,-790560234,-889820876,-264255093,-891084846,518292719,-563110686,-653664803,-965040252,-645924283,38394224,-462713626,-389613607,-603830531,8615393,-992272399}

    {36209007,-691315951,-192011978,-991576310,-828616435,-391690368,186694136,-664646355,-921206181,-970358839,-770254685,-552959602,526208346,-977358510,-945384696,-334768840,-617622856,-968593498,72686112,-519456619,-283906081,-359356945,330259469,-861278478,-828218308,-865286317,-8844488,-69989705,-968417437,-438865413,-906864194,-782503391,135732106,-625203981,-664064729,-474604315,-800295710,-972767251,-195381850,446673254,738864987,-997889014,-158392418,-18100691,103141023,-76505179,-684032653,-42587193,-974967477,-949689616}

    {342784118,802842497,-409147628,866200841,-390723838,-946436064,-16567707,-146291566,847816631,-697827994,926579191,-869265527,-921487403,-128848450,-706312906,133643988,-802829495,132209087,-818984583,826723826,-287019527,-645487293,-528825676,933233767,-207683761,-951873946,749889769,343681362,-738053849,361833783,-95168243,-730132428,-612392055,-359310893,764046788,-110681132,-829605100,-204063675,-212932346,803345223,304605814,15971777,-758350866,176742862,660031909,-70357168,630102120,26703310,716565821,-682827801}

    {792602188,-337685402,-99008564,-789940276,-443579238,975694337,656617751,-267355410,60467652,-894103757,-129254958,993862595,527920580,-966876367,-252995059,-284007777,-50859145,-875217499,813779129,-28783152,80254155,-293937810,710760856,-770819402,-709237271,-862095912,874751965,406474433,183092778,-247359052,-868956457,-777136254,478855304,303465172,400428344,-13063324,-467555317,372781350,-160580574,894759137,864908505,-995595141,-141832111,23934332,269858974,820005163,-649172635,24361132,-951127937,-393814424}

    Returns: 7

  9. {-529476332,-532532977,-969458536,-807730487,-916789189,212684460,-989418433,479691746,151990030,266520723,163265797,-529799073,-771099949,-830896061,-626991592,572170937,-502522885,-994835049,14523924,-703718688,1196933,-569422515,-983245055,-931491800,23028263,-208158034,-287788480,-829435840,-382157349,-958974900,-639577791,-887672667,-765290139,-375486748,-755144659,631052932,-255216298,523972500,-214865925,-768253741,-478954526,287162150,-781926337,14904437,732745545,-680409906,-214143886,146688936,-488530762,-939849448}

    {-675675761,663822851,-904274754,444842774,-449613659,-464081984,-763115894,-168842420,-677246352,61450741,-670836692,-789138222,-440228470,-328856693,-571718717,-427212002,-62317336,-998151092,-933645286,168002835,-962444205,-137741506,-990692103,111301033,-293501957,207704698,-225160224,-635099022,-998166625,597774566,-157093241,-965201460,-705514100,-323400705,-950266819,-384238628,-282088704,-386783774,-934674284,-612856232,-811111851,212122105,777626326,-174696009,-299125412,-445167980,190297645,-855162213,-32316378,-990008236}

    {850663544,83438304,-762370021,-356294195,-290989989,255511418,-913563273,848779403,221130859,311513308,487894936,-232689471,451488874,-628538363,-597037736,642508129,-241856102,-940319711,723549590,316871757,194473549,261978730,-825415333,366798349,71406201,-74110478,517466936,-793665772,-158773620,-941320293,-479180425,810539658,-608276678,354248510,-235732463,999803834,263326932,799096024,505116641,-717118517,-299561206,442382229,80837602,115370608,843595310,-26305189,730262573,842584529,-411095583,315123875}

    {-665260066,887347747,-641133220,946439635,654937881,-119488542,-579944605,577379083,85063290,218130057,-14239880,-761755088,690554279,383583704,291203853,735061632,203204270,-997519709,-508030434,263941141,-525286567,-61511437,-83392740,268005383,-96611194,666939331,-175479601,-359272675,-996860106,756128796,474808236,-847222113,424416170,-114128787,-772626658,-197107376,52919511,-67548452,-909962705,-432627134,-516859477,239797379,941375141,-39186165,850200506,-239576849,883067691,471221006,276069139,-150705132}

    Returns: 9

  10. {-820670808,-947132210,-782840063,-865570948,-39474490,-981312154,-567195363,-753525946,309787212,-777831976,-163447644,406437728,-252124556,520891436,-355090150,-590348362,-689118895,17383070,30148681,332575516,-667278093,-633093416,-947563490,21099401,-167938048,-978146512,-968468638,-599491529,-246584019,-48036011,-527382160,-998597457,-105162773,-999233443,-335032578,-735347044,-333055130,-58076311,534388824,-998721415,-570059713,-393491072,428896436,-647860328,-505181489,-411575053,-736661914,-997043499,-840960005,562388682}

    {136672446,-493023513,-713271028,-145569795,-977782126,-581047866,-809970282,-849269924,624158758,-254222194,-905848665,-306553532,156036773,-801082237,-891515860,-645345092,-745095639,-670523155,164917824,503603030,94595295,-315468784,-330669597,-597906421,-357825444,-917285243,-796963034,306838474,-306934272,710387707,-529968694,-593708233,-861736620,-995168803,-307145357,-871861128,-796920302,-907512249,-382481553,-436009465,-913035270,-844150457,-441153349,-415645777,-899901892,-86260126,-811435218,-181265242,-744533081,-812904964}

    {268146897,-471075610,-729814206,-312373232,826692340,-668568932,-303277594,223794298,758725394,-522397701,683160893,863735028,-114925099,797639382,110957272,-379554716,-77443343,391375530,98149593,526535980,-302635415,-386782780,-835881939,637728824,43554997,-861983828,-665409450,-343993072,-72677315,406378762,416524477,-997982294,937270089,-999122297,217666201,-72301128,520838235,-16871837,673247434,-989434483,271769716,-199081648,529513351,-198481749,-123167127,-219060061,-362578719,-338692936,-531850855,907132675}

    {223727910,862847233,325359734,-119151221,-971503024,-479438600,-793367513,-696811809,856216546,-201272700,-635936496,-188028243,797003894,-467839426,-326795745,-639394671,-386814464,-358972664,184240145,595545842,534346310,116176178,-258112249,-391944519,27027817,-322142321,-337994069,724730920,276247827,893718104,447390765,658015299,-446401917,-504667922,-289820997,-416738178,123598200,-839128919,788287660,667192330,698383195,-278458646,605420413,402569095,-772094979,28755218,773975675,56109069,-584375399,-531850954}

    Returns: 8

  11. {-330655209,-949069143,-175081665,-489559640,-859788058,677971105,-817960990,-665144962,-625898077,-853987490,-71195856,-371430641,-730151968,-546562857,-399368596,-232471722,-955473417,-997821434,133525639,230447394,218461499,-570284387,184065421,-925953632,-200675154,-478159980,-689472266,-844341595,-623168568,-968690029,-216308402,626988503,-731014105,-911630742,-892631208,-841740363,-767559218,-425277551,280795726,-989971975,-158763226,-975324873,-935155445,247568928,-940819415,-202518706,-783158510,-623074513,-655098050,-649273315}

    {-693401644,-834889320,-107990238,-834311458,-538014361,-691827143,-938650840,-662965411,-944692600,-908391858,-538715304,-875031989,-780171130,-906093809,-646012012,236563360,-853032570,-951522776,-968153146,-924543985,-838944330,897535216,-115598862,104360698,-960735321,-614600386,-533782865,-558657102,-616012218,-901713602,-312119389,-801743442,-864968678,-649239282,-259264449,-581360019,62629452,-513319885,299692592,-828892710,-265032137,-694934600,-901658816,-215051483,-630342371,-53746924,-680222415,-938979460,-449923586,-985575994}

    {609064474,-707561693,-90393946,-461457215,-808582754,895280625,596479025,-276872478,-410563768,-803212429,425657033,242316534,-480010713,3161483,-325598790,-8073570,-925367620,-905744682,415769439,998959694,306027816,-388532504,425336408,-651970530,8031572,33056628,-609799852,10240467,127475616,-903479370,999586366,898326151,622025518,-475773486,-886771658,-672905652,-345926856,-158970291,393971234,-981112748,261609804,232651357,-926110913,364350072,-752355512,497254129,-228657805,556258464,843812192,116311546}

    {-554915248,219977043,762360,363610351,-100269860,301943683,-682041098,649365928,-670647336,-870741804,-444417611,-773719109,-563572926,-388473889,-641436636,962424993,405108709,559780127,-952456675,-889861162,123511819,918727445,-37765758,509481297,-957256137,-197259035,-24260617,564318021,-588969407,260850371,215314143,-791997281,-861946396,393879924,-94304799,-550095814,97191604,-442896804,430007389,878262401,685344954,-648054732,-834835263,13044517,-77164675,777130703,-415514538,-480600979,714302870,-904517209}

    Returns: 8

  12. {-15201390,-846500619,257017944,-520431993,-968733791,-841309722,132006445,-861554073,-743226769,-748301089,-849462791,-603832251,-988850557,-488946581,-602051781,-278051631,-256704064,-594217427,-998735273,-560392373,-787237946,-908211147,430755350,231568040,-689457416,-687168494,-444640422,-494998503,-492268854,-930010590,-16183861,-814086595,16388388,275204076,-849967112,-709721499,-73649847,-738698164,-752058676,-989699304,-641823860,-656881779,-816911693,191555542,629965246,-979838346,-559320075,-587983470,-719490872,-529901902}

    {-669788293,-966500166,-842201799,-806462179,-912928532,-264868643,254217648,-909687378,-954277887,-884066622,-885015528,98921420,-622952565,-889763179,-802221576,-848264042,-131872461,-980986040,210620441,-867093623,542826971,-750828662,310520929,-279292278,-173915470,-303995525,-561884303,-145317487,-625848612,-732140206,-784574474,6459091,-817226226,-422598332,206865146,-366599410,-367352769,-843317915,-943070680,-876663548,-494657591,-910395394,-729368709,492079895,-753433423,-924916859,-873440552,-586007464,-501748839,-922598255}

    {57155747,-198083073,601196801,400314470,-379913480,789700672,680765139,-361073793,-705531705,914020914,-798345668,-50698975,29359568,994638125,-200184330,-171127258,854568648,-483230338,-994335075,452794408,-314431146,165398319,663392850,394293629,-560682629,-413235961,319181021,533689573,703430681,-887903707,260412726,-555443489,738804980,495267509,-302344558,-256246896,-25904820,-614818953,830149427,-950944508,-45429613,734978992,-2971064,562607532,706738887,-936913516,620867044,-197127686,336209151,-82170792}

    {-22847102,-824114020,-712060720,-739251537,-731329682,-54183268,520220327,187061193,-824179946,-610606538,-818682121,388347671,-110360792,980201136,-691380278,-267216073,417936299,-835157929,505388453,-90981955,763949509,585729406,632639786,-18691207,78886716,610157058,790969816,-95955588,-297317635,992713511,-512683528,965056996,-22358844,73824315,756170137,668273901,829487935,-298339762,144911295,-817835811,817620171,-715363086,520715949,874308787,-198246873,-855211836,-277538440,606205863,75981953,-775470831}

    Returns: 15

  13. {214979788,-852199153,-681940301,-824335305,-448970054,590061153,-747946533,-509624963,49643494,-841808408,-328472028,-852340595,559762830,-388475481,-732482209,-503340406,-996690069,-887851425,-406782151,-883439894,-435702821,-917911665,-817069599,-551307415,-994827568,-859724455,-878713052,-968942315,-944735906,-856199929,-720280780,154720763,-106182654,-678491856,-827519270,-408200429,-982806787,174600994,220769723,-973325978,-776225687,-941725029,193605648,-960255804,-567686931,-860523863,-935472859,-999370973,-895384952,677973624}

    {-450042802,-21250446,-576657361,-269215107,-132626968,-968585547,-549439085,-556112872,-517431476,-449822968,-963531723,362147540,-30308239,-991770057,-926700476,-797167674,-521281014,-648844996,-818315084,-391033461,372583953,297471883,-868759930,-841381336,-740988169,-234483868,-832463108,564841367,-592314692,-824339368,-291439612,-915769901,390684487,-609571848,-640555840,-709724551,401713546,-895533053,-520787704,-960538309,-224638206,-940861385,-936248402,245856627,-764569240,-809251228,635518842,-545334645,457066981,138420595}

    {433957818,-665607553,619825158,-727870507,178445086,740878649,-505640356,454450671,777383682,-549794164,838465232,213497183,784944413,289347797,445630095,981130952,-995496443,-376218350,10547656,314642849,608414779,-148734645,-728003187,404604533,-913472346,-690864745,250499508,-162200185,-873566636,695689582,-282362957,155222958,676274151,583119329,-419134826,275798757,718185781,345935255,540052502,-587747553,-655177818,-270814778,248629300,-936860076,-223344834,-806883415,987552818,-711033507,287645704,920765051}

    {272364146,847957,-321186825,804892410,713299951,-954826097,851776539,-401046797,220576430,774709987,-412082376,779053940,610075894,-988147986,-696240746,-602629251,-89501037,-499684799,-684837714,702674912,488400265,469780359,792326846,-779863615,709659101,191808697,-656047251,795618593,654799749,-342984807,704387018,-786870197,732957718,874327671,417051957,218676410,602137061,-853842551,584832384,-923919715,403570332,-530842684,-542404951,662293993,-696821971,-750674217,636920910,801422212,556505565,822889755}

    Returns: 11

  14. {-638576998,-839934967,-702104974,-593571796,94437538,-603223981,-775420710,183491683,-969202686,132648225,-773770291,521410746,-318682776,-701953515,-607373744,-910089178,-605356134,-919149002,-806087409,-639511630,673357131,-817156803,-683749517,-997276051,532734028,-957946636,445364509,-274430537,-239894081,-219280286,-975225079,152834119,-887540669,-992856612,-970981706,-940832763,-978581589,-739785243,-700334410,-909915009,-43433729,-782507404,-865236874,-175337731,265017464,-866081582,-739770973,5639363,-126735340,-950059262}

    {-214748334,377117365,-995287956,-972481741,-34550492,-883102637,-643562305,-338708653,-603654011,-855186255,-981042589,-325919927,-994875949,-580599291,-564072710,-596261826,-519744625,-706049289,-935263439,-508833337,-799645532,354716694,-711903266,-669437682,-597124152,-934995271,-972170753,-986128292,-815938518,-488213328,350952722,-997225627,238777237,-733518299,-276894996,-972764252,-929726717,-201207656,-789025554,-979712943,-645759577,-375952525,204733739,-877675045,31329703,-635347288,122957263,85925915,-945181572,-174869991}

    {442301206,-765708064,-674092057,-37188740,959094316,-595773932,-546758584,499803569,-444014969,748150300,-729451626,973329139,-287747554,-294399525,804768325,-524224647,-491795038,-534464335,-528030107,-510830092,865106996,473561905,19438165,-878962979,809217800,-657810173,719647925,833212749,580090446,65356261,-373837275,798603321,-448506455,-933787737,-966123109,744224691,-961549994,506509136,267517051,-635729605,228254121,-780086465,661364213,231983775,584189448,-460927261,65451799,902037719,6568457,-418534998}

    {767907525,466767275,-913599456,-423679644,767794659,-838451091,407080624,386696015,864240561,-443864190,-812827261,895279215,-933005976,-345071314,53968396,-140261825,-125672339,-580955943,-403496264,760573251,-720333426,425225190,-169967605,-531386548,-266832926,-556597071,-489824396,-372250934,877136588,-54854605,652033043,653164197,410905738,-625123529,501173526,-860931804,-423754338,848901412,-388618786,-389713588,677644058,35579554,540400252,-497736278,687443436,38021050,543763126,525615591,646677893,645536585}

    Returns: 12

  15. {-825745110,376397075,-296258533,-226188278,-198914887,-643520194,-865345470,-269065742,-527039776,-768631333,-825841755,-913897132,-947177650,-934212882,-550829445,-776553112,-953487045,-437809207,-297030589,-707450496,-759361374,-681233289,-998304939,-968297820,583805812,-337737235,708208141,-366033567,-773580473,-531322034,-787083243,-300748227,-443949244,-315432241,226480942,-811943939,-479326280,-70180257,-507529700,-701207537,-935452795,-555310109,-585961462,97271347,189450677,-927631632,285484549,-771778653,437478871,-772960035}

    {876530488,-701064806,-327997388,-878988235,-710941961,-964491435,-414513716,233152318,-812774406,-924587220,651109569,-669952885,333598579,-943830985,-788216398,-999989435,-755418239,-708378720,-558132439,-929019432,-496872157,-998204417,-997612682,-936692059,-886192144,216739524,-856678070,-5495713,-33201203,-262540789,-943418384,528585560,-928395974,-921860644,-981619787,-890100435,-328544470,-686681042,-924205118,-958496741,-893612135,-789803915,-952388271,-207294248,-940524936,-659334596,-879220348,-698231757,-883377606,-96566526}

    {-401737150,686669524,272626133,13233148,180796752,-452906229,-517033420,-232868458,515667873,-544515172,911674497,-580351747,-880733096,-711318627,-394298774,-776343074,-919885301,-351847398,839088451,-659053154,-671715923,-613609431,-861593869,47596119,725110667,219447626,810150868,-268850760,-269312769,-419256232,517342985,-127278299,12150947,550703969,737124785,-708189909,-185180520,448150458,-432307881,710662791,-366736662,-466835289,-502129808,363807789,852222885,-551958984,615436182,-271224206,894658336,-769891079}

    {908877483,-218728796,985744225,272247410,-144988940,-476848237,-261358592,272174449,-405817188,-469261578,723232454,-619393288,544899110,495625153,-553212401,-953217254,167314474,-102784268,72674616,386882763,-176706770,-820824417,-451016280,-932105505,-818246767,991306996,-764274450,631915363,380782435,-224110646,141116365,726051014,-100415837,-536233411,-756012194,-566035268,-194324433,-339840027,935239680,-13000437,-883828463,574970627,-717233045,463396096,774153436,935648527,-850470662,-195419019,327981712,457328404}

    Returns: 9

  16. {0, 5, 10, 15 }

    {0, 5, 10, 15 }

    {10, 15, 20, 25 }

    {10, 15, 20, 25 }

    Returns: 2

  17. {0, 0, 1 }

    {0, 0, 0 }

    {2, 1, 2 }

    {1, 1, 1 }

    Returns: 2

  18. {0, 100 }

    {0, 100 }

    {100, 200 }

    {100, 200 }

    Returns: 1

  19. {0, 4, 0 }

    {0, 4, 0 }

    {5, 5, 1 }

    {5, 5, 1 }

    Returns: 2

  20. {0, 90 }

    {0, -10 }

    {100, 110 }

    {100, 10 }

    Returns: 2

  21. {0, 5, 90, 150 }

    {0, 5, 90, 150 }

    {100, 95, 200, 300 }

    {100, 95, 200, 300 }

    Returns: 3

  22. {1, 2, 4 }

    {1, 2, 4 }

    {3, 5, 6 }

    {3, 5, 6 }

    Returns: 2

  23. {0, 90 }

    {0, 90 }

    {1000000000, 200 }

    {1000000000, 200 }

    Returns: 2

  24. {0, 5, 4, 11, 12 }

    {0, 5, 4, 11, 12 }

    {10, 6, 8, 17, 16 }

    {10, 6, 8, 17, 16 }

    Returns: 3

  25. {0, 50, 100 }

    {0, 0, 0 }

    {75, 125, 200 }

    {100, 100, 100 }

    Returns: 2

  26. {0, 1, 2 }

    {0, 1, 2 }

    {2, 3, 4 }

    {2, 3, 4 }

    Returns: 2

  27. {-100, 0, 1, 2, 3 }

    {-100, 0, 0, 0, 0 }

    {100, 1, 2, 3, 4 }

    {100, 1, 1, 1, 1 }

    Returns: 2

  28. {0, 1, 1 }

    {0, 1, -1 }

    {2, 3, 3 }

    {2, 3, 1 }

    Returns: 2

  29. {0, 10, 25 }

    {0, 10, 25 }

    {30, 20, 35 }

    {30, 20, 35 }

    Returns: 2

  30. {0, 0, 90 }

    {0, 0, 90 }

    {100, 10, 100 }

    {100, 10, 100 }

    Returns: 2

  31. {0, 0, 1 }

    {0, 0, 1 }

    {2, 1, 2 }

    {2, 1, 2 }

    Returns: 2

  32. {0, 1, 3 }

    {0, 1, 3 }

    {2, 4, 7 }

    {2, 4, 7 }

    Returns: 2

  33. {0, 0, 6, 6 }

    {0, 0, 6, 6 }

    {5, 5, 9, 9 }

    {5, 5, 9, 9 }

    Returns: 2

  34. {0, -1, 1, 1 }

    {0, -1, 1, 1 }

    {2, 1, 3, 2 }

    {2, 1, 3, 2 }

    Returns: 3

  35. {0, 1, 3 }

    {0, 1, 3 }

    {2, 4, 5 }

    {2, 4, 5 }

    Returns: 2

  36. {0, 10, 20 }

    {0, 10, 20 }

    {100, 15, 25 }

    {100, 15, 25 }

    Returns: 2

  37. {1, 5, 15 }

    {1, 5, 15 }

    {10, 20, 30 }

    {10, 20, 30 }

    Returns: 2

  38. {0, 0, 10, 20, 30 }

    {0, 0, 0, 0, 0 }

    {100, 10, 20, 30, 40 }

    {1, 1, 1, 1, 1 }

    Returns: 2

  39. {1, 2, 8 }

    {1, 2, 8 }

    {10, 5, 9 }

    {10, 5, 9 }

    Returns: 2

  40. {0, 50 }

    {200, 0 }

    {100, 150 }

    {300, 100 }

    Returns: 1

  41. {0, 5, 80 }

    {0, 5, 80 }

    {100, 6, 90 }

    {100, 6, 90 }

    Returns: 2


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: