Statistics

Problem Statement for "TypoCoderDiv1"

Problem Statement

TypoCoder is a programming contest like TopCoder. TypoCoder also has a rating system. There are two types of coders in TypoCoder: brown coders and ciel coders. A brown coder is a coder whose rating is greater than or equal to 2200. A ciel coder is a coder whose rating is less than 2200.

Cat Lower competes in TypoCoder. He is currently a ciel coder. His rating at the end of the current year is X.

Next year there will be some contests. In each of those contests, Cat Lower can either try his best or lose on purpose. For each i, the i-th contest (0-based index) has weight D[i]. If Cat Lower tries his best in the i-th contest, his rating will increase by D[i]. If he decides to lose on purpose instead, his rating will decrease by D[i], but not below zero. Formally, his rating will decrease by min(D[i],his rating before the contest).

Cat Lower loves being a ciel coder. Therefore, he must never be a brown coder twice in a row. That is, whenever Cat Lower becomes a brown coder, he must be ciel again after the next contest (if there are any contests left).

TypoCoder awards "Chameleon coder of the year" to the coder whose color changed the most times during the year.

You are given the int[] D and the int X. Return the maximal number of color changes Cat Lower can have next year.

Definition

Class:
TypoCoderDiv1
Method:
getmax
Parameters:
int[], int
Returns:
int
Method signature:
int getmax(int[] D, int X)
(be sure your method is public)

Constraints

  • D will contain between 1 and 50 elements, inclusive.
  • Each element of D will be between 0 and 1,000,000,000 (10^9), inclusive.
  • X will be between 0 and 2199, inclusive.

Examples

  1. {100,200,100,1,1}

    2000

    Returns: 3

    When he increase at the second, the third and the last competition and decrease at the first and the fourth competition, he can change the color 3 times and this is the maximal.

  2. {0,0,0,0,0}

    2199

    Returns: 0

    He cannot be a brown coder in this case.

  3. {90000,80000,70000,60000,50000,40000,30000,20000,10000}

    0

    Returns: 1

    Note that Cat Lower always has at least one valid strategy: if he decides to lose in all contests, he will remain ciel forever. In this test case, the optimal strategy for him is to lose in the first eight contests and then to win in the last one. Note that before the last contest his rating will be 0.

  4. {1000000000,1000000000,10000,100000,2202,1}

    1000

    Returns: 4

  5. {2048,1024,5012,256,128,64,32,16,8,4,2,1,0}

    2199

    Returns: 0

  6. {0}

    0

    Returns: 0

  7. {861}

    779

    Returns: 0

  8. {803,354}

    1411

    Returns: 2

  9. {976,473,746}

    34

    Returns: 1

  10. {803,480,149,200}

    819

    Returns: 2

  11. {69,713,54,633,680}

    1311

    Returns: 2

  12. {329,458,920,718,849,779}

    1181

    Returns: 4

  13. {177,63,502,511,529,327,155}

    933

    Returns: 2

  14. {786,314,657,705,434,407,719,275}

    1634

    Returns: 6

  15. {767,471,82,498,403,586,643,7,819}

    1771

    Returns: 7

  16. {214,828,418,827,111,950,738,40,404,148}

    2199

    Returns: 4

  17. {61,666,512,229,618,419,757,217,458,883,23,932,547,679,565,767,513,798,870,31,379,294,929,892,173,127,796,353,913,115,802,803,948,592,959,127,501,319,140,694,851,189,924,590,790,3,669,541,342,272}

    1223

    Returns: 29

  18. {118,745,416,909,128,894,694,849,458,617,599,881,971,598,339,732,991,558,386,193,672,633,106,93,230,144,456,21,576,493,835,382,48,865,586,244,207,786,744,137,216,423,510,242,958,671,543,718,751,899}

    1875

    Returns: 36

  19. {416,728,624,823,149,579,108,660,352,321,44,239,58,852,652,74,765,503,940,662,192,211,767,764,411,475,999,780,438,736,623,796,868,228,765,583,937,457,104,458,501,724,960,490,867,587,669,651,158,159}

    0

    Returns: 34

  20. {996,214,877,585,262,385,535,498,972,162,458,421,290,266,912,379,367,284,422,221,537,662,881,173,832,756,493,898,820,953,443,316,929,490,161,822,956,292,310,0,185,561,966,869,590,208,961,343,254,195}

    894

    Returns: 32

  21. {563,952,522,895,379,305,162,145,625,40,112,266,44,788,392,526,918,661,481,685,230,463,358,19,947,260,706,535,510,602,723,852,788,408,475,176,705,762,556,511,607,531,755,457,240,476,118,733,156,817}

    445

    Returns: 35

  22. {290,781,454,932,260,578,732,256,451,790,230,51,436,56,292,753,889,269,532,586,231,712,825,914,332,547,243,17,270,819,374,644,901,995,496,361,382,659,427,947,835,795,714,71,95,275,308,864,961,94}

    1383

    Returns: 36

  23. {557,474,513,443,223,668,14,311,927,146,270,710,471,712,682,684,418,982,588,812,241,94,438,25,630,891,223,614,862,798,841,155,151,863,238,636,395,356,228,258,919,434,901,777,912,759,634,229,817,351}

    1391

    Returns: 32

  24. {438,791,718,562,702,589,834,309,990,148,888,342,938,464,434,138,536,932,27,367,304,955,780,908,219,483,375,709,755,378,362,322,206,333,324,130,314,30,60,895,65,805,482,854,890,540,27,771,128,631}

    1140

    Returns: 31

  25. {121,605,246,678,522,63,439,859,834,875,645,90,446,133,338,576,388,617,225,534,470,424,20,521,521,868,844,67,75,358,850,0,513,368,853,8,309,793,889,24,72,792,290,697,721,572,940,551,576,2}

    1127

    Returns: 32

  26. {478,553,282,863,287,668,44,17,33,252,389,443,269,417,873,928,315,105,692,726,38,552,679,227,766,892,477,188,181,243,57,287,183,111,221,438,625,732,437,700,770,869,892,216,452,644,85,916,921,711}

    516

    Returns: 35

  27. {954,998,786,61,513,688,785,438,618,238,700,350,973,58,465,371,643,450,294,857,88,311,620,958,810,839,521,876,777,618,982,170,985,581,424,177,417,687,438,695,632,472,558,840,197,393,941,819,327,284}

    906

    Returns: 36

  28. {139,745,172,171,500,707,349,809,173,688,940,59,958,249,674,242,327,563,225,181,481,446,683,186,11,212,992,978,450,23,97,725,965,922,883,657,161,576,802,908,130,59,623,68,409,386,951,735,636,179}

    1523

    Returns: 32

  29. {326,13,28,687,676,981,197,636,177,909,835,768,466,307,266,853,652,738,377,902,748,645,616,159,25,413,776,714,145,784,434,912,118,870,525,198,772,559,346,186,325,91,863,915,214,976,672,704,482,864}

    77

    Returns: 31

  30. {123,282,599,630,654,396,930,166,646,384,383,785,580,728,972,839,300,450,391,78,444,764,367,325,915,615,27,699,769,197,295,825,137,69,762,772,903,799,297,742,58,719,584,673,75,33,866,382,463,515}

    1656

    Returns: 36

  31. {89,511,26,119,774,845,435,220,687,810,947,448,752,905,798,199,204,481,493,629,811,613,713,384,561,694,427,218,798,222,44,289,990,127,737,334,291,262,27,857,497,325,508,712,146,768,397,423,389,860}

    1143

    Returns: 33

  32. {360,864,387,113,695,6,850,505,249,636,72,195,384,752,251,667,708,671,439,547,843,174,765,869,805,493,86,568,916,711,437,815,804,535,38,706,350,380,442,139,398,989,822,952,72,34,576,972,404,795}

    813

    Returns: 35

  33. {803,230,237,484,121,310,558,928,501,668,210,709,154,593,852,12,605,407,486,314,813,670,558,205,121,643,772,318,405,304,511,454,994,713,127,214,543,738,569,799,408,512,919,561,487,459,110,154,207,49}

    530

    Returns: 34

  34. {814,907,623,619,270,422,245,417,110,710,269,352,855,808,7,678,237,788,900,852,437,149,309,908,311,158,992,154,498,717,642,788,835,510,13,245,575,611,238,397,885,989,457,633,981,572,577,18,684,524}

    11

    Returns: 36

  35. {844,275,857,389,493,958,774,311,198,813,40,145,640,969,432,633,820,490,151,839,61,290,438,163,489,253,463,480,277,123,994,77,657,680,700,619,540,182,770,124,632,144,973,622,88,357,19,367,568,480}

    335

    Returns: 31

  36. {537,850,353,764,96,770,44,841,651,132,830,71,154,172,880,242,618,603,432,610,120,692,796,93,769,185,613,922,891,628,458,431,405,676,960,219,480,964,401,528,425,298,555,158,774,439,927,309,856,914}

    1059

    Returns: 32

  37. {602,877,475,329,718,998,350,675,843,819,639,738,29,48,365,669,162,826,144,709,115,316,345,322,396,436,953,237,568,597,194,397,811,287,592,131,191,490,700,572,633,447,752,434,386,716,837,738,443,81}

    1570

    Returns: 34

  38. {244,274,641,230,232,461,371,976,920,324,223,612,366,513,131,818,308,67,189,876,379,970,108,443,183,502,618,817,183,206,242,917,870,229,437,952,949,601,370,550,133,617,387,937,142,21,825,822,643,322}

    791

    Returns: 30

  39. {632,868,153,239,225,438,843,735,295,374,179,738,826,745,989,272,329,126,281,772,670,550,147,299,314,871,330,930,695,353,713,334,321,511,454,555,720,363,411,26,161,797,346,865,108,534,723,803,781,368}

    2199

    Returns: 37

  40. {58118606,841835304,896666470,26105222,663802166,345457797,460896338,104216615,14970931,360850618,322517598,304544558,26855505,181885243,869027998,510257717,792225726,332144060,828196445,301629839,431297153,846920424,462932430,965076507,96867358,257081480,31336596,540675457,129095342,539908102,910040317,462052463,207856667,284087178,797053365,72915569,426289393,433360337,15631913,732556857,559347348,414954917,60866788,224363453,42754086,746858813,414153376,681290505,66711731,237599183}

    1708

    Returns: 38

  41. {139845877,481018430,348305702,726490370,679115395,809838538,204953480,89368572,926520351,623614860,374754660,725012547,463664351,736075941,368028598,703743226,619955353,791941205,52188329,955917527,780713082,319686004,106068081,860767513,115239730,951376163,408914557,679289099,788819441,271791956,102665901,869408144,456920598,855947492,64030438,856221475,19390356,269177526,466118900,832986622,560261161,741024479,933728178,151973948,868087753,94450600,26776223,642371247,933254860,141357979}

    1180

    Returns: 41

  42. {387364447,411326672,210495189,680053492,544049288,643993068,273912996,598268251,369037881,279872009,612646911,365524390,565192310,659962067,22401892,491939197,3021607,37519899,384233922,129179103,800195582,344549160,14798386,194327606,534425533,313321377,155459373,111062190,458938087,758651832,843906763,204455884,316207188,619666038,224391294,363194126,55150908,1353830,278984340,725979557,329310823,661643842,577728328,106440609,886416090,901165391,832047893,608406965,326217388,2867903}

    1465

    Returns: 35

  43. {632936672,73121291,27365262,366457976,76103036,310956087,56735989,79027855,76265139,533432492,803150466,260655598,119479353,778233082,233493875,878934056,852155126,395739417,228505338,581433508,895353684,584431037,735216059,155398775,447096673,308502258,971926348,405511754,115932478,709489917,567826875,841939435,706333962,65298718,111409809,6403326,832474888,342460989,278646741,346920458,274036001,518129639,951632666,779498253,22386402,438620189,725640019,65146598,495191194,179265433}

    468

    Returns: 37

  44. {482865815,978029270,898106752,965109748,448527423,525775969,614482156,352737469,403775763,3902799,962811961,484326960,913173168,428788045,833036630,46240548,923293669,872840239,365104216,945778833,30891137,643780632,791447016,129266972,129526218,546211515,477320258,470154661,90028692,722212465,647326411,462833975,664848391,749492196,723748517,486927189,518065384,226203950,556711038,849144265,538827540,928903959,30208870,352810907,490564582,729208841,123817258,85001263,539601986,267137421}

    1517

    Returns: 39

  45. {49281574,139705054,823216407,708498475,730025288,960940105,443319295,39598200,392973986,994546755,127581615,75523599,955271594,661935386,182741042,220056262,311733878,244167444,28465538,117401041,414803072,863312942,301097062,859827280,492612875,588109518,282420463,701861771,63112226,17744411,316045900,849360847,676932498,629110658,400834825,967681714,932908467,614498122,621078031,687942597,992250909,550508608,831601958,703512008,674336652,304904945,434407451,434607735,860318698,368962035}

    356

    Returns: 35

  46. {131810212,717066536,59043588,208138602,82106498,717884021,913612101,570505457,118215591,13021618,396958888,249317965,546442458,418317034,585908738,155638071,966955829,617861154,101960611,545995927,148900036,537434875,144703421,871886921,168052697,520682674,117840393,563562617,394020649,258458973,708024977,361878990,219475204,135826660,63557859,917563654,412263671,133273275,891467682,51409902,196270329,180537711,50399213,389489482,619567918,77277170,155746911,648746062,700588215,133293004}

    0

    Returns: 39

  47. {978086294,502004051,866319741,89738905,501234719,466553630,904064213,160425366,970127955,37670239,201988164,436405019,2499828,5398481,123914149,151921809,784766158,867741279,359207954,424529739,923626617,26246334,887987903,548822718,414136139,184566824,841203278,11623723,524857740,214192882,757175402,6372939,321760579,259206685,35413610,343573051,996225021,416910866,929268348,357538783,495081575,484382547,699940230,127510991,474503187,13777529,778179674,483349266,513455639,59631027}

    1218

    Returns: 43

  48. {158463636,211586550,695204996,999328092,30617635,134978390,277543007,330837365,548431472,487936980,664258614,220023323,112633174,531135920,859370508,258096812,63635991,669201687,693872648,874370304,104081485,38808315,2278673,435930043,609512784,377343076,278847319,570551257,533471122,97899807,222561225,462974079,872092672,685647529,280770101,881515048,133731083,350417219,855018237,123922113,847299248,387376457,258673673,21520583,712164363,65579141,529511876,333866764,71416584,441125771}

    1331

    Returns: 36

  49. {759039067,116735889,120495290,673217065,460853990,746978848,77076552,285948901,667755699,220493871,431198822,194271307,942713309,48236797,114512260,255184686,157153121,660597415,170298915,765646601,293388761,155431193,784924577,28300696,848890263,210278151,534284542,884147865,79308393,496300011,280778507,815773268,958691406,949635779,430073149,956943088,630426211,681992557,128681460,26244269,646260026,512949034,135055380,778535359,225917542,245040498,669498587,241420007,949448466,576870852}

    137

    Returns: 39

  50. {127796860,398179020,635745088,236550191,499808118,111990740,32692408,498466202,387750067,449991071,355504141,658591833,822220593,4238106,362887191,191461657,965565993,881207619,54717752,518256948,150852804,352373368,372276128,225019585,978441306,380744863,470622959,577800012,163749950,218857843,497258568,565881899,364982508,47716124,746474315,187325009,953378339,54253306,95226192,29765438,51510362,884701549,795140793,140572670,372852990,182920984,303879231,375101429,110708189,951694221}

    291

    Returns: 40

  51. {171456089,532412127,833745087,215859112,637194179,614597442,142865624,255825222,392244860,832049377,633348553,760175739,686407948,969208930,831024015,934463664,775868915,301128399,239024592,491897854,308169806,826856525,403914516,188440823,379511414,421903508,88740209,541515154,209497292,295289211,884039638,762325920,317278016,82697989,276160092,503483655,757198983,48193737,183781418,525786518,791779199,624320781,147245603,648666855,162334744,55810718,353362265,167303900,613531955,208073369}

    1267

    Returns: 39

  52. {567140911,50360722,304097736,107052739,230045343,694493779,576300786,529040910,801254368,605191217,966231927,188658475,97126353,108021729,690496166,960412152,159947812,386328818,185379245,463177496,143438544,733430583,211674701,383780275,94668562,395096263,156434295,464190715,638236032,152173059,67062683,279555662,590770176,257447951,541142330,385895265,341104915,316452562,94194493,431396012,567981412,498780569,376348942,750306357,167945493,659367271,763083755,169308979,953156356,618352319}

    578

    Returns: 37

  53. {25689283,908544912,305605814,329010852,62482186,604553875,784821746,447503726,500369666,959993388,564232205,910367930,525793213,111323486,555572665,250883499,88568632,159809231,204681598,962298739,448539394,726972566,986427557,107174237,331600004,481203263,159826639,851762923,246434537,122286874,133641139,986212058,780249838,916857262,70330140,922657130,118968923,203413504,124279351,847420882,491216870,954795022,242124370,695754103,490751206,718314762,356120078,273226757,802067613,595519472}

    1084

    Returns: 41

  54. {307232370,103755202,849937228,981254799,67976411,18239473,608144837,8577964,874393755,498222442,378821619,358915756,15546669,447344596,973355403,801319022,691830995,920046685,135354973,164322547,105077387,804085475,149987754,845863547,879869867,400461427,341453891,739241253,234841276,695361124,328404094,454635068,304771850,551984855,80102945,965433593,448939397,214393468,626435588,538089922,416660115,655358516,166952949,364570861,364594514,762130485,180085618,894523103,864263121,883864917}

    320

    Returns: 38

  55. {27,82,51,25,80,45,0,63,61,62,52,18,38,40,42,50,68,53,99,64,67,51,17,95,1,50,47,87,42,86,13,56,12,56,92,66,67,46,3,42,99,33,58,70,90,43,44,65,28,18}

    779

    Returns: 18

  56. {77,98,2,43,67,57,14,14,96,25,17,59,15,97,57,19,84,65,70,27,59,77,78,32,54,75,95,36,16,5,8,43,21,71,7,40,59,38,87,77,16,10,89,64,67,0,97,23,44,12}

    606

    Returns: 12

  57. {34,64,43,14,58,30,2,16,90,58,35,55,46,24,14,73,96,13,9,42,64,36,89,42,42,64,52,68,53,76,52,54,23,88,32,52,28,96,70,32,26,3,23,78,47,23,54,30,86,32}

    1328

    Returns: 20

  58. {2,98,62,68,12,80,6,74,98,18,2,77,87,53,91,30,80,26,60,4,47,64,51,28,81,54,65,72,52,25,9,72,49,67,16,98,23,9,4,29,44,76,50,8,19,43,79,50,5,87}

    738

    Returns: 17

  59. {60,42,2,12,43,12,16,44,55,73,28,78,31,55,16,82,14,61,83,50,70,49,46,79,6,76,49,34,57,1,99,95,44,11,88,61,11,32,38,75,51,44,57,74,13,59,90,77,31,3}

    2199

    Returns: 32

  60. {26,77,14,94,40,94,24,87,27,10,15,40,53,45,64,42,29,31,21,6,84,60,1,88,46,66,5,0,64,73,94,75,86,58,30,45,50,81,36,82,43,12,61,49,13,77,32,33,80,18}

    954

    Returns: 16

  61. {13,36,62,15,78,91,8,92,76,95,96,94,86,51,40,71,78,19,55,37,74,26,79,49,20,68,11,99,64,7,60,18,24,4,7,5,48,57,41,92,58,59,16,82,22,67,36,61,77,48}

    286

    Returns: 9

  62. {59,68,4,98,84,96,32,6,67,95,12,54,0,73,87,51,25,2,63,89,24,60,8,43,21,36,47,28,86,22,59,41,38,11,87,24,55,70,68,12,42,30,84,25,44,25,19,26,97,74}

    203

    Returns: 6

  63. {23,58,52,71,40,18,77,45,4,39,33,75,89,35,25,90,6,10,16,67,78,78,40,97,35,16,3,32,91,64,66,1,9,28,79,76,78,94,3,12,35,15,62,59,82,49,51,69,58,6}

    543

    Returns: 10

  64. {81,55,12,45,52,18,9,76,15,32,76,49,43,94,94,97,7,51,1,42,4,35,33,29,51,10,77,33,11,92,55,68,91,47,11,90,36,4,62,5,78,92,3,17,46,78,2,93,97,42}

    0

    Returns: 2

  65. {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}

    2121

    Returns: 0

  66. {1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000,1000000000}

    2158

    Returns: 50

  67. {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}

    2197

    Returns: 48

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

    2189

    Returns: 41

  69. {1,2,4,8,16,32,64,128,256,512,1024,2048,1896,1592,984,1968,1736,1272,344,688,1376,552,1104,8,16,32,64,128,256,512,1024,2048,1896,1592,984,1968,1736,1272,344,688,1376,552,1104,8,16,32,64,128,256,512}

    2195

    Returns: 32

  70. {1024,512,256,128,64,32,16,8,1104,552,1376,688,344,1272,1736,1968,984,1592,1896,2048,1024,512,256,128,64,32,16,8,1104,552,1376,688,344,1272,1736,1968,984,1592,1896,2048,1024,512,256,128,64,32,16,8,4,2}

    2188

    Returns: 28

  71. {34, 64, 43, 14, 58, 30, 2, 16, 90, 58, 35, 55, 46, 24, 14, 73, 96, 13, 9, 42, 64, 36, 89, 42, 42, 64, 52, 68, 53, 76, 52, 54, 23, 88, 32, 52, 28, 96, 70, 32, 26, 3, 23, 78, 47, 23, 54, 30, 86, 32 }

    1328

    Returns: 20

  72. {1000000000, 1000000000, 10000, 100000, 2202, 1 }

    1000

    Returns: 4

  73. {2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 }

    2199

    Returns: 50

  74. {3000, 30000, 3000 }

    0

    Returns: 3

  75. {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 }

    1000

    Returns: 0

  76. {1, 1, 202, 1 }

    2000

    Returns: 2

  77. {313, 49200, 3770, 249, 111, 35, 258, 6170, 13700, 2100, 1390, 729, 72600, 6330, 910, 42700, 13700, 477, 9290, 414, 12200, 256, 61200, 8440, 1300, 1500, 260, 57000, 7500, 528, 75500, 3240, 726, 13700, 734, 22300, 20200, 77700, 709, 676, 7240, 526, 43900, 2510, 825, 294, 7500, 53400, 606, 1750 }

    2000

    Returns: 11

  78. {880641847, 874970313, 446064254, 77814904, 714504434, 414906606, 526301748, 13136569, 327998473, 342691263, 189861234, 956251262, 46012189, 852925376, 962720332, 746289310, 342179099, 631482674, 792426959, 87665298, 856420153, 249037437, 158051302, 654713205, 252742854, 417108800, 90835006, 336611363, 635683955, 812182689, 339970820, 300138075, 888202834, 492389415, 966836660, 729213477, 10420737, 10791477, 830200592, 123424220, 50289888, 597694500, 513997357, 304991452, 590622333, 34503676, 161894055, 169422536, 311235345, 239313358 }

    1788

    Returns: 37

  79. {17713, 18958, 17578, 8365, 13007, 11477, 1200, 26058, 6439, 2303, 12760, 19357, 2324, 6477, 5108, 21113, 14887, 19801, 22850, 14460, 22428, 12993, 27384, 19405, 6540, 31111, 28704, 12835, 32356, 6072, 29350, 18823, 14485, 20556, 23216, 1626, 9357, 8526, 13357, 29337, 23271, 23869, 29361, 12896, 13022 }

    629

    Returns: 34

  80. {5, 1 }

    2199

    Returns: 0

  81. {2200, 5000, 2200 }

    100

    Returns: 3

  82. {5000, 10000, 2000, 2000, 2000, 2000, 5000, 10000, 2000, 2000, 2000 }

    0

    Returns: 8

  83. {5, 2200, 1, 1000000, 0, 0 }

    0

    Returns: 2

  84. {2200, 2200 }

    0

    Returns: 2

  85. {1, 100000, 2200 }

    2199

    Returns: 3

  86. {200, 300, 100 }

    2000

    Returns: 2

  87. {54057531, 983206610, 925719726, 857119526, 780206765, 764820747, 50092962, 239010309, 597748172, 607539685, 70663703, 346892805, 250165344, 687316171, 216598847, 23138837, 348034594, 880013416, 798834446, 68462520, 891234251, 704502692, 56157847, 994095574 }

    1608

    Returns: 16

  88. {200, 5000, 2400 }

    2100

    Returns: 3

  89. {2, 0, 3 }

    2199

    Returns: 1

  90. {2200 }

    0

    Returns: 1

  91. {1, 2, 4, 8, 16, 1000000000 }

    2199

    Returns: 6

  92. {1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 2048, 1000, 3012, 8048, 120000, 34000, 550000, 26000, 1, 2, 4, 8, 10000000, 4096, 16008, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 4048, 8096, 1000000, 1, 2, 4, 8, 16, 32 }

    2000

    Returns: 10

  93. {3000, 2801, 1, 1, 1, 1 }

    2000

    Returns: 6


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: