#include<bits/stdc++.h>
using namespace std;
int main(){
long long a,b,c,d;
vector <long long> herk={0,1,3,6,10,15,21,28,36,45,55,66,78,91,105,120,136,153,171,190,210,231,253,276,300,325,351,378,406,435,465,496,528,561,595,630,666,703,741,780,820,861,903,946,990,1035,1081,1128,1176,1225,1275,1326,1378,1431,1485,1540,1596,1653,1711,1770,1830,1891,1953,2016,2080,2145,2211,2278,2346,2415,2485,2556,2628,2701,2775,2850,2926,3003,3081,3160,3240,3321,3403,3486,3570,3655,3741,3828,3916,4005,4095,4186,4278,4371,4465,4560,4656,4753,4851,4950,5050,5151,5253,5356,5460,5565,5671,5778,5886,5995,6105,6216,6328,6441,6555,6670,6786,6903,7021,7140,7260,7381,7503,7626,7750,7875,8001,8128,8256,8385,8515,8646,8778,8911,9045,9180,9316,9453,9591,9730,9870,10011,10153,10296,10440,10585,10731,10878,11026,11175,11325,11476,11628,11781,11935,12090,12246,12403,12561,12720,12880,13041,13203,13366,13530,13695,13861,14028,14196,14365,14535,14706,14878,15051,15225,15400,15576,15753,15931,16110,16290,16471,16653,16836,17020,17205,17391,17578,17766,17955,18145,18336,18528,18721,18915,19110,19306,19503,19701,19900,20100,20301,20503,20706,20910,21115,21321,21528,21736,21945,22155,22366,22578,22791,23005,23220,23436,23653,23871,24090,24310,24531,24753,24976,25200,25425,25651,25878,26106,26335,26565,26796,27028,27261,27495,27730,27966,28203,28441,28680,28920,29161,29403,29646,29890,30135,30381,30628,30876,31125,31375,31626,31878,32131,32385,32640,32896,33153,33411,33670,33930,34191,34453,34716,34980,35245,35511,35778,36046,36315,36585,36856,37128,37401,37675,37950,38226,38503,38781,39060,39340,39621,39903,40186,40470,40755,41041,41328,41616,41905,42195,42486,42778,43071,43365,43660,43956,44253,44551,44850,45150,45451,45753,46056,46360,46665,46971,47278,47586,47895,48205,48516,48828,49141,49455,49770,50086,50403,50721,51040,51360,51681,52003,52326,52650,52975,53301,53628,53956,54285,54615,54946,55278,55611,55945,56280,56616,56953,57291,57630,57970,58311,58653,58996,59340,59685,60031,60378,60726,61075,61425,61776,62128,62481,62835,63190,63546,63903,64261,64620,64980,65341,65703,66066,66430,66795,67161,67528,67896,68265,68635,69006,69378,69751,70125,70500,70876,71253,71631,72010,72390,72771,73153,73536,73920,74305,74691,75078,75466,75855,76245,76636,77028,77421,77815,78210,78606,79003,79401,79800,80200,80601,81003,81406,81810,82215,82621,83028,83436,83845,84255,84666,85078,85491,85905,86320,86736,87153,87571,87990,88410,88831,89253,89676,90100,90525,90951,91378,91806,92235,92665,93096,93528,93961,94395,94830,95266,95703,96141,96580,97020,97461,97903,98346,98790,99235,99681,100128,100576,101025,101475,101926,102378,102831,103285,103740,104196,104653,105111,105570,106030,106491,106953,107416,107880,108345,108811,109278,109746,110215,110685,111156,111628,112101,112575,113050,113526,114003,114481,114960,115440,115921,116403,116886,117370,117855,118341,118828,119316,119805,120295,120786,121278,121771,122265,122760,123256,123753,124251,124750,125250,125751,126253,126756,127260,127765,128271,128778,129286,129795,130305,130816,131328,131841,132355,132870,133386,133903,134421,134940,135460,135981,136503,137026,137550,138075,138601,139128,139656,140185,140715,141246,141778,142311,142845,143380,143916,144453,144991,145530,146070,146611,147153,147696,148240,148785,149331,149878,150426,150975,151525,152076,152628,153181,153735,154290,154846,155403,155961,156520,157080,157641,158203,158766,159330,159895,160461,161028,161596,162165,162735,163306,163878,164451,165025,165600,166176,166753,167331,167910,168490,169071,169653,170236,170820,171405,171991,172578,173166,173755,174345,174936,175528,176121,176715,177310,177906,178503,179101,179700,180300,180901,181503,182106,182710,183315,183921,184528,185136,185745,186355,186966,187578,188191,188805,189420,190036,190653,191271,191890,192510,193131,193753,194376,195000,195625,196251,196878,197506,198135,198765,199396,200028,200661,201295,201930,202566,203203,203841,204480,205120,205761,206403,207046,207690,208335,208981,209628,210276,210925,211575,212226,212878,213531,214185,214840,215496,216153,216811,217470,218130,218791,219453,220116,220780,221445,222111,222778,223446,224115,224785,225456,226128,226801,227475,228150,228826,229503,230181,230860,231540,232221,232903,233586,234270,234955,235641,236328,237016,237705,238395,239086,239778,240471,241165,241860,242556,243253,243951,244650,245350,246051,246753,247456,248160,248865,249571,250278,250986,251695,252405,253116,253828,254541,255255,255970,256686,257403,258121,258840,259560,260281,261003,261726,262450,263175,263901,264628,265356,266085,266815,267546,268278,269011,269745,270480,271216,271953,272691,273430,274170,274911,275653,276396,277140,277885,278631,279378,280126,280875,281625,282376,283128,283881,284635,285390,286146,286903,287661,288420,289180,289941,290703,291466,292230,292995,293761,294528,295296,296065,296835,297606,298378,299151,299925,300700,301476,302253,303031,303810,304590,305371,306153,306936,307720,308505,309291,310078,310866,311655,312445,313236,314028,314821,315615,316410,317206,318003,318801,319600,320400,321201,322003,322806,323610,324415,325221,326028,326836,327645,328455,329266,330078,330891,331705,332520,333336,334153,334971,335790,336610,337431,338253,339076,339900,340725,341551,342378,343206,344035,344865,345696,346528,347361,348195,349030,349866,350703,351541,352380,353220,354061,354903,355746,356590,357435,358281,359128,359976,360825,361675,362526,363378,364231,365085,365940,366796,367653,368511,369370,370230,371091,371953,372816,373680,374545,375411,376278,377146,378015,378885,379756,380628,381501,382375,383250,384126,385003,385881,386760,387640,388521,389403,390286,391170,392055,392941,393828,394716,395605,396495,397386,398278,399171,400065,400960,401856,402753,403651,404550,405450,406351,407253,408156,409060,409965,410871,411778,412686,413595,414505,415416,416328,417241,418155,419070,419986,420903,421821,422740,423660,424581,425503,426426,427350,428275,429201,430128,431056,431985,432915,433846,434778,435711,436645,437580,438516,439453,440391,441330,442270,443211,444153,445096,446040,446985,447931,448878,449826,450775,451725,452676,453628,454581,455535,456490,457446,458403,459361,460320,461280,462241,463203,464166,465130,466095,467061,468028,468996,469965,470935,471906,472878,473851,474825,475800,476776,477753,478731,479710,480690,481671,482653,483636,484620,485605,486591,487578,488566,489555,490545,491536,492528,493521,494515,495510,496506,497503,498501,499500,500500,501501,502503,503506,504510,505515,506521,507528,508536,509545,510555,511566,512578,513591,514605,515620,516636,517653,518671,519690,520710,521731,522753,523776,524800,525825,526851,527878,528906,529935,530965,531996,533028,534061,535095,536130,537166,538203,539241,540280,541320,542361,543403,544446,545490,546535,547581,548628,549676,550725,551775,552826,553878,554931,555985,557040,558096,559153,560211,561270,562330,563391,564453,565516,566580,567645,568711,569778,570846,571915,572985,574056,575128,576201,577275,578350,579426,580503,581581,582660,583740,584821,585903,586986,588070,589155,590241,591328,592416,593505,594595,595686,596778,597871,598965,600060,601156,602253,603351,604450,605550,606651,607753,608856,609960,611065,612171,613278,614386,615495,616605,617716,618828,619941,621055,622170,623286,624403,625521,626640,627760,628881,630003,631126,632250,633375,634501,635628,636756,637885,639015,640146,641278,642411,643545,644680,645816,646953,648091,649230,650370,651511,652653,653796,654940,656085,657231,658378,659526,660675,661825,662976,664128,665281,666435,667590,668746,669903,671061,672220,673380,674541,675703,676866,678030,679195,680361,681528,682696,683865,685035,686206,687378,688551,689725,690900,692076,693253,694431,695610,696790,697971,699153,700336,701520,702705,703891,705078,706266,707455,708645,709836,711028,712221,713415,714610,715806,717003,718201,719400,720600,721801,723003,724206,725410,726615,727821,729028,730236,731445,732655,733866,735078,736291,737505,738720,739936,741153,742371,743590,744810,746031,747253,748476,749700,750925,752151,753378,754606,755835,757065,758296,759528,760761,761995,763230,764466,765703,766941,768180,769420,770661,771903,773146,774390,775635,776881,778128,779376,780625,781875,783126,784378,785631,786885,788140,789396,790653,791911,793170,794430,795691,796953,798216,799480,800745,802011,803278,804546,805815,807085,808356,809628,810901,812175,813450,814726,816003,817281,818560,819840,821121,822403,823686,824970,826255,827541,828828,830116,831405,832695,833986,835278,836571,837865,839160,840456,841753,843051,844350,845650,846951,848253,849556,850860,852165,853471,854778,856086,857395,858705,860016,861328,862641,863955,865270,866586,867903,869221,870540,871860,873181,874503,875826,877150,878475,879801,881128,882456,883785,885115,886446,887778,889111,890445,891780,893116,894453,895791,897130,898470,899811,901153,902496,903840,905185,906531,907878,909226,910575,911925,913276,914628,915981,917335,918690,920046,921403,922761,924120,925480,926841,928203,929566,930930,932295,933661,935028,936396,937765,939135,940506,941878,943251,944625,946000,947376,948753,950131,951510,952890,954271,955653,957036,958420,959805,961191,962578,963966,965355,966745,968136,969528,970921,972315,973710,975106,976503,977901,979300,980700,982101,983503,984906,986310,987715,989121,990528,991936,993345,994755,996166,997578,998991,1000405,1001820,1003236,1004653,1006071,1007490,1008910,1010331,1011753,1013176,1014600,1016025,1017451,1018878,1020306,1021735,1023165,1024596,1026028,1027461,1028895,1030330,1031766,1033203,1034641,1036080,1037520,1038961,1040403,1041846,1043290,1044735,1046181,1047628,1049076,1050525,1051975,1053426,1054878,1056331,1057785,1059240,1060696,1062153,1063611,1065070,1066530,1067991,1069453,1070916,1072380,1073845,1075311,1076778,1078246,1079715,1081185,1082656,1084128,1085601,1087075,1088550,1090026,1091503,1092981,1094460,1095940,1097421,1098903,1100386,1101870,1103355,1104841,1106328,1107816,1109305,1110795,1112286,1113778,1115271,1116765,1118260,1119756,1121253,1122751,1124250,1125750};
long long arr[1501]={2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,131072,262144,524288,1048576,2097152,4194304,8388608,16777216,33554432,67108864,134217728,268435456,536870912,73741817,147483634,294967268,589934536,179869065,359738130,719476260,438952513,877905026,755810045,511620083,23240159,46480318,92960636,185921272,371842544,743685088,487370169,974740338,949480669,898961331,797922655,595845303,191690599,383381198,766762396,533524785,67049563,134099126,268198252,536396504,72793001,145586002,291172004,582344008,164688009,329376018,658752036,317504065,635008130,270016253,540032506,80065005,160130010,320260020,640520040,281040073,562080146,124160285,248320570,496641140,993282280,986564553,973129099,946258191,892516375,785032743,570065479,140130951,280261902,560523804,121047601,242095202,484190404,968380808,936761609,873523211,747046415,494092823,988185646,976371285,952742563,905485119,810970231,621940455,243880903,487761806,975523612,951047217,902094427,804188847,608377687,216755367,433510734,867021468,734042929,468085851,936171702,872343397,744686787,489373567,978747134,957494261,914988515,829977023,659954039,319908071,639816142,279632277,559264554,118529101,237058202,474116404,948232808,896465609,792931211,585862415,171724823,343449646,686899292,373798577,747597154,495194301,990388602,980777197,961554387,923108767,846217527,692435047,384870087,769740174,539480341,78960675,157921350,315842700,631685400,263370793,526741586,53483165,106966330,213932660,427865320,855730640,711461273,422922539,845845078,691690149,383380291,766760582,533521157,67042307,134084614,268169228,536338456,72676905,145353810,290707620,581415240,162830473,325660946,651321892,302643777,605287554,210575101,421150202,842300404,684600801,369201595,738403190,476806373,953612746,907225485,814450963,628901919,257803831,515607662,31215317,62430634,124861268,249722536,499445072,998890144,997780281,995560555,991121103,982242199,964484391,928968775,857937543,715875079,431750151,863500302,727000597,454001187,908002374,816004741,632009475,264018943,528037886,56075765,112151530,224303060,448606120,897212240,794424473,588848939,177697871,355395742,710791484,421582961,843165922,686331837,372663667,745327334,490654661,981309322,962618637,925237267,850474527,700949047,401898087,803796174,607592341,215184675,430369350,860738700,721477393,442954779,885909558,771819109,543638211,87276415,174552830,349105660,698211320,396422633,792845266,585690525,171381043,342762086,685524172,371048337,742096674,484193341,968386682,936773357,873546707,747093407,494186807,988373614,976747221,953494435,906988863,813977719,627955431,255910855,511821710,23643413,47286826,94573652,189147304,378294608,756589216,513178425,26356843,52713686,105427372,210854744,421709488,843418976,686837945,373675883,747351766,494703525,989407050,978814093,957628179,915256351,830512695,661025383,322050759,644101518,288203029,576406058,152812109,305624218,611248436,222496865,444993730,889987460,779974913,559949819,119899631,239799262,479598524,959197048,918394089,836788171,673576335,347152663,694305326,388610645,777221290,554442573,108885139,217770278,435540556,871081112,742162217,484324427,968648854,937297701,874595395,749190783,498381559,996763118,993526229,987052451,974104895,948209783,896419559,792839111,585678215,171356423,342712846,685425692,370851377,741702754,483405501,966811002,933621997,867243987,734487967,468975927,937951854,875903701,751807395,503614783,7229559,14459118,28918236,57836472,115672944,231345888,462691776,925383552,850767097,701534187,403068367,806136734,612273461,224546915,449093830,898187660,796375313,592750619,185501231,371002462,742004924,484009841,968019682,936039357,872078707,744157407,488314807,976629614,953259221,906518435,813036863,626073719,252147431,504294862,8589717,17179434,34358868,68717736,137435472,274870944,549741888,99483769,198967538,397935076,795870152,591740297,183480587,366961174,733922348,467844689,935689378,871378749,742757491,485514975,971029950,942059893,884119779,768239551,536479095,72958183,145916366,291832732,583665464,167330921,334661842,669323684,338647361,677294722,354589437,709178874,418357741,836715482,673430957,346861907,693723814,387447621,774895242,549790477,99580947,199161894,398323788,796647576,593295145,186590283,373180566,746361132,492722257,985444514,970889021,941778035,883556063,767112119,534224231,68448455,136896910,273793820,547587640,95175273,190350546,380701092,761402184,522804361,45608715,91217430,182434860,364869720,729739440,459478873,918957746,837915485,675830963,351661919,703323838,406647669,813295338,626590669,253181331,506362662,12725317,25450634,50901268,101802536,203605072,407210144,814420288,628840569,257681131,515362262,30724517,61449034,122898068,245796136,491592272,983184544,966369081,932738155,865476303,730952599,461905191,923810382,847620757,695241507,390483007,780966014,561932021,123864035,247728070,495456140,990912280,981824553,963649099,927298191,854596375,709192743,418385479,836770958,673541909,347083811,694167622,388335237,776670474,553340941,106681875,213363750,426727500,853455000,706909993,413819979,827639958,655279909,310559811,621119622,242239237,484478474,968956948,937913889,875827771,751655535,503311063,6622119,13244238,26488476,52976952,105953904,211907808,423815616,847631232,695262457,390524907,781049814,562099621,124199235,248398470,496796940,993593880,987187753,974375499,948750991,897501975,795003943,590007879,180015751,360031502,720063004,440126001,880252002,760503997,521007987,42015967,84031934,168063868,336127736,672255472,344510937,689021874,378043741,756087482,512174957,24349907,48699814,97399628,194799256,389598512,779197024,558394041,116788075,233576150,467152300,934304600,868609193,737218379,474436751,948873502,897746997,795493987,590987967,181975927,363951854,727903708,455807409,911614818,823229629,646459251,292918495,585836990,171673973,343347946,686695892,373391777,746783554,493567101,987134202,974268397,948536787,897073567,794147127,588294247,176588487,353176974,706353948,412707889,825415778,650831549,301663091,603326182,206652357,413304714,826609428,653218849,306437691,612875382,225750757,451501514,903003028,806006049,612012091,224024175,448048350,896096700,792193393,584386779,168773551,337547102,675094204,350188401,700376802,400753597,801507194,603014381,206028755,412057510,824115020,648230033,296460059,592920118,185840229,371680458,743360916,486721825,973443650,946887293,893774579,787549151,575098295,150196583,300393166,600786332,201572657,403145314,806290628,612581249,225162491,450324982,900649964,801299921,602599835,205199663,410399326,820798652,641597297,283194587,566389174,132778341,265556682,531113364,62226721,124453442,248906884,497813768,995627536,991255065,982510123,965020239,930040471,860080935,720161863,440323719,880647438,761294869,522589731,45179455,90358910,180717820,361435640,722871280,445742553,891485106,782970205,565940403,131880799,263761598,527523196,55046385,110092770,220185540,440371080,880742160,761484313,522968619,45937231,91874462,183748924,367497848,734995696,469991385,939982770,879965533,759931059,519862111,39724215,79448430,158896860,317793720,635587440,271174873,542349746,84699485,169398970,338797940,677595880,355191753,710383506,420767005,841534010,683068013,366136019,732272038,464544069,929088138,858176269,716352531,432705055,865410110,730820213,461640419,923280838,846561669,693123331,386246655,772493310,544986613,89973219,179946438,359892876,719785752,439571497,879142994,758285981,516571955,33143903,66287806,132575612,265151224,530302448,60604889,121209778,242419556,484839112,969678224,939356441,878712875,757425743,514851479,29702951,59405902,118811804,237623608,475247216,950494432,900988857,801977707,603955407,207910807,415821614,831643228,663286449,326572891,653145782,306291557,612583114,225166221,450332442,900664884,801329761,602659515,205319023,410638046,821276092,642552177,285104347,570208694,140417381,280834762,561669524,123339041,246678082,493356164,986712328,973424649,946849291,893698575,787397143,574794279,149588551,299177102,598354204,196708401,393416802,786833604,573667201,147334395,294668790,589337580,178675153,357350306,714700612,429401217,858802434,717604861,435209715,870419430,740838853,481677699,963355398,926710789,853421571,706843135,413686263,827372526,654745045,309490083,618980166,237960325,475920650,951841300,903682593,807365179,614730351,229460695,458921390,917842780,835685553,671371099,342742191,685484382,370968757,741937514,483875021,967750042,935500077,871000147,742000287,484000567,968001134,936002261,872004515,744009023,488018039,976036078,952072149,904144291,808288575,616577143,233154279,466308558,932617116,865234225,730468443,460936879,921873758,843747509,687495011,374990015,749980030,499960053,999920106,999840205,999680403,999360799,998721591,997443175,994886343,989772679,979545351,959090695,918181383,836362759,672725511,345451015,690902030,381804053,763608106,527216205,54432403,108864806,217729612,435459224,870918448,741836889,483673771,967347542,934695077,869390147,738780287,477560567,955121134,910242261,820484515,640969023,281938039,563876078,127752149,255504298,511008596,22017185,44034370,88068740,176137480,352274960,704549920,409099833,818199666,636399325,272798643,545597286,91194565,182389130,364778260,729556520,459113033,918226066,836452125,672904243,345808479,691616958,383233909,766467818,532935629,65871251,131742502,263485004,526970008,53940009,107880018,215760036,431520072,863040144,726080281,452160555,904321110,808642213,617284419,234568831,469137662,938275324,876550641,753101275,506202543,12405079,24810158,49620316,99240632,198481264,396962528,793925056,587850105,175700203,351400406,702800812,405601617,811203234,622406461,244812915,489625830,979251660,958503313,917006619,834013231,668026455,336052903,672105806,344211605,688423210,376846413,753692826,507385645,14771283,29542566,59085132,118170264,236340528,472681056,945362112,890724217,781448427,562896847,125793687,251587374,503174748,6349489,12698978,25397956,50795912,101591824,203183648,406367296,812734592,625469177,250938347,501876694,3753381,7506762,15013524,30027048,60054096,120108192,240216384,480432768,960865536,921731065,843462123,686924239,373848471,747696942,495393877,990787754,981575501,963150995,926301983,852603959,705207911,410415815,820831630,641663253,283326499,566652998,133305989,266611978,533223956,66447905,132895810,265791620,531583240,63166473,126332946,252665892,505331784,10663561,21327122,42654244,85308488,170616976,341233952,682467904,364935801,729871602,459743197,919486394,838972781,677945555,355891103,711782206,423564405,847128810,694257613,388515219,777030438,554060869,108121731,216243462,432486924,864973848,729947689,459895371,919790742,839581477,679162947,358325887,716651774,433303541,866607082,733214157,466428307,932856614,865713221,731426435,462852863,925705726,851411445,702822883,405645759,811291518,622583029,245166051,490332102,980664204,961328401,922656795,845313583,690627159,381254311,762508622,525017237,50034467,100068934,200137868,400275736,800551472,601102937,202205867,404411734,808823468,617646929,235293851,470587702,941175404,882350801,764701595,529403183,58806359,117612718,235225436,470450872,940901744,881803481,763606955,527213903,54427799,108855598,217711196,435422392,870844784,741689561,483379115,966758230,933516453,867032899,734065791,468131575,936263150,872526293,745052579,490105151,980210302,960420597,920841187,841682367,683364727,366729447,733458894,466917781,933835562,867671117,735342227,470684447,941368894,882737781,765475555,530951103,61902199,123804398,247608796,495217592,990435184,980870361,961740715,923481423,846962839,693925671,387851335,775702670,551405333,102810659,205621318,411242636,822485272,644970537,289941067,579882134,159764261,319528522,639057044,278114081,556228162,112456317,224912634,449825268,899650536,799301065,598602123,197204239,394408478,788816956,577633905,155267803,310535606,621071212,242142417,484284834,968569668,937139329,874278651,748557295,497114583,994229166,988458325,976916643,953833279,907666551,815333095,630666183,261332359,522664718,45329429,90658858,181317716,362635432,725270864,450541721,901083442,802166877,604333747,208667487,417334974,834669948,669339889,338679771,677359542,354719077,709438154,418876301,837752602,675505197,351010387,702020774,404041541,808083082,616166157,232332307,464664614,929329228,858658449,717316891,434633775,869267550,738535093,477070179,954140358,908280709,816561411,633122815,266245623,532491246,64982485,129964970,259929940,519859880,39719753,79439506,158879012,317758024,635516048,271032089,542064178,84128349,168256698,336513396,673026792,346053577,692107154,384214301,768428602,536857197,73714387,147428774,294857548,589715096,179430185,358860370,717720740,435441473,870882946,741765885,483531763,967063526,934127045,868254083,736508159,473016311,946032622,892065237,784130467,568260927,136521847,273043694,546087388,92174769,184349538,368699076,737398152,474796297,949592594,899185181,798370355,596740703,193481399,386962798,773925596,547851185,95702363,191404726,382809452,765618904,531237801,62475595,124951190,249902380,499804760,999609520,999219033,998438059,996876111,993752215,987504423,975008839,950017671,900035335,800070663,600141319,200282631,400565262,801130524,602261041,204522075,409044150,818088300,636176593,272353179,544706358,89412709,178825418,357650836,715301672,430603337,861206674,722413341,444826675,889653350,779306693,558613379,117226751,234453502,468907004,937814008,875628009,751256011,502512015,5024023,10048046,20096092,40192184,80384368,160768736,321537472,643074944,286149881,572299762,144599517,289199034,578398068,156796129,313592258,627184516,254369025,508738050,17476093,34952186,69904372,139808744,279617488,559234976,118469945,236939890,473879780,947759560,895519113,791038219,582076431,164152855,328305710,656611420,313222833,626445666,252891325,505782650,11565293,23130586,46261172,92522344,185044688,370089376,740178752,480357497,960714994,921429981,842859955,685719903,371439799,742879598,485759189,971518378,943036749,886073491,772146975,544293943,88587879,177175758,354351516,708703032,417406057,834812114,669624221,339248435,678496870,356993733,713987466,427974925,855949850,711899693,423799379,847598758,695197509,390395011,780790022,561580037,123160067,246320134,492640268,985280536,970561065,941122123,882244239,764488471,528976935,57953863,115907726,231815452,463630904,927261808,854523609,709047211,418094415,836188830,672377653,344755299,689510598,379021189,758042378,516084749,32169491,64338982,128677964,257355928,514711856,29423705,58847410,117694820,235389640,470779280,941558560,883117113,766234219,532468431,64936855,129873710,259747420,519494840,38989673,77979346,155958692,311917384,623834768,247669529};
cin>>a;
for(long long i=0;a>i;i++){
cin>>b;
if(b>2){
auto low = lower_bound(herk.begin(),herk.end(),b-2);
if(herk[low - herk.begin()] == b-2){
cout<<arr[low - herk.begin()]<<"\n";
for(long long g=0;(low - herk.begin())>g;g++){
cout<<"1 ";
}
cout<<"0 \n";
}
else{
cout<<"2\n";
for(long long g=0;b>g;g++){
cout<<"1 ";
}
cout<<"\n";
}
}
else{
cout<<"2\n";
for(long long g=0;b>g;g++){
cout<<"1 ";
}
cout<<"\n";
}
}
}
Compilation message
binary.cpp: In function 'int main()':
binary.cpp:4:16: warning: unused variable 'c' [-Wunused-variable]
4 | long long a,b,c,d;
| ^
binary.cpp:4:18: warning: unused variable 'd' [-Wunused-variable]
4 | long long a,b,c,d;
| ^
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
68 ms |
4172 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
19 ms |
1304 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
342 ms |
20340 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |