{"group":{"id":1,"name":"Community","lockable":false,"created_at":"2012-01-18T18:02:15.000Z","updated_at":"2025-12-14T01:33:56.000Z","description":"Problems submitted by members of the MATLAB Central community.","is_default":true,"created_by":161519,"badge_id":null,"featured":false,"trending":false,"solution_count_in_trending_period":0,"trending_last_calculated":"2025-12-14T00:00:00.000Z","image_id":null,"published":true,"community_created":false,"status_id":2,"is_default_group_for_player":false,"deleted_by":null,"deleted_at":null,"restored_by":null,"restored_at":null,"description_opc":null,"description_html":null,"published_at":null},"problems":[{"id":1854,"title":"Factorial: Unlimited Size : java.math","description":"This challenge is an application of java.math that allows unlimited precision calculations.  The primary reference sites are \u003chttp://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Number.html Java Math\u003e, \u003chttp://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigDecimal.html Java BigDecimal\u003e, and \u003chttp://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigInteger.html Java BigInteger\u003e.\r\n\r\nThe usage of BigDecimal function multiply will be essential.\r\n\r\nJava Math tutorial: (Simplified summary that is believed correct)\r\n\r\n  vd-decimal value, vstr-string, vi-integer value \r\n  xBD=java.math.BigDecimal(vd);  % valid vd,vstr,vi creates xBD a BigDecimal variable\r\n  import java.math.*;  % simplifies statements\r\n  xBD=BigDecimal(vstr);\r\n \r\n  xmultiplyzBD=xBD.multiply(BigDecimal(z));  % multiply input requires BD type\r\n  \r\n  To convert java to string of unlimited length can be achieved via java toString or Matlab char\r\n  \r\n  xstr=toString(xBD)  or xstr=char(xBD) \r\n\r\n*Input:* N  [1\u003c N \u003c 1000]\r\n\r\n*Output:* Y  (char variable of Y=N! or a BigDecimal variable)\r\n\r\n\u003chttp://www.nitrxgen.net/factorialcalc.php Factorial Calculator\u003e\r\n\r\n*Related Challenges:*\r\n\r\n\u003chttp://www.mathworks.com/matlabcentral/cody/problems/1833-usage-of-java-math-add-multiply-pow 1. Usage of java math\u003e\r\n\r\n  2. nchoosek_large (full precision)\r\n  2. Next Prime\r\n  3. factor_large\r\n  4. Factorial","description_html":"\u003cp\u003eThis challenge is an application of java.math that allows unlimited precision calculations.  The primary reference sites are \u003ca href = \"http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Number.html\"\u003eJava Math\u003c/a\u003e, \u003ca href = \"http://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigDecimal.html\"\u003eJava BigDecimal\u003c/a\u003e, and \u003ca href = \"http://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigInteger.html\"\u003eJava BigInteger\u003c/a\u003e.\u003c/p\u003e\u003cp\u003eThe usage of BigDecimal function multiply will be essential.\u003c/p\u003e\u003cp\u003eJava Math tutorial: (Simplified summary that is believed correct)\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003evd-decimal value, vstr-string, vi-integer value \r\nxBD=java.math.BigDecimal(vd);  % valid vd,vstr,vi creates xBD a BigDecimal variable\r\nimport java.math.*;  % simplifies statements\r\nxBD=BigDecimal(vstr);\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003exmultiplyzBD=xBD.multiply(BigDecimal(z));  % multiply input requires BD type\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eTo convert java to string of unlimited length can be achieved via java toString or Matlab char\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003exstr=toString(xBD)  or xstr=char(xBD) \r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003eInput:\u003c/b\u003e N  [1\u0026lt; N \u0026lt; 1000]\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput:\u003c/b\u003e Y  (char variable of Y=N! or a BigDecimal variable)\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://www.nitrxgen.net/factorialcalc.php\"\u003eFactorial Calculator\u003c/a\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003eRelated Challenges:\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/1833-usage-of-java-math-add-multiply-pow\"\u003e1. Usage of java math\u003c/a\u003e\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e2. nchoosek_large (full precision)\r\n2. Next Prime\r\n3. factor_large\r\n4. Factorial\r\n\u003c/pre\u003e","function_template":"function y = factorialJava(N)\r\n import java.math.*\r\n y = num2str(factorial(N));\r\nend","test_suite":"%%\r\ntic\r\nN=69;\r\ny = factorialJava(N);\r\nassert(strcmp(y,'171122452428141311372468338881272839092270544893520369393648040923257279754140647424000000000000000'))\r\ntoc\r\n%%\r\ntic\r\nN=randi(18)\r\ny = factorialJava(N);\r\nassert(strcmp(y,num2str(factorial(N))))\r\ntoc\r\n%%\r\ntic\r\nN=randi(18)\r\ny = factorialJava(N);\r\nassert(strcmp(y,num2str(factorial(N))))\r\ntoc\r\n%%\r\ntic\r\nN=1000;\r\ny = factorialJava(N);\r\nassert(strcmp(y,'402387260077093773543702433923003985719374864210714632543799910429938512398629020592044208486969404800479988610197196058631666872994808558901323829669944590997424504087073759918823627727188732519779505950995276120874975462497043601418278094646496291056393887437886487337119181045825783647849977012476632889835955735432513185323958463075557409114262417474349347553428646576611667797396668820291207379143853719588249808126867838374559731746136085379534524221586593201928090878297308431392844403281231558611036976801357304216168747609675871348312025478589320767169132448426236131412508780208000261683151027341827977704784635868170164365024153691398281264810213092761244896359928705114964975419909342221566832572080821333186116811553615836546984046708975602900950537616475847728421889679646244945160765353408198901385442487984959953319101723355556602139450399736280750137837615307127761926849034352625200015888535147331611702103968175921510907788019393178114194545257223865541461062892187960223838971476088506276862967146674697562911234082439208160153780889893964518263243671616762179168909779911903754031274622289988005195444414282012187361745992642956581746628302955570299024324153181617210465832036786906117260158783520751516284225540265170483304226143974286933061690897968482590125458327168226458066526769958652682272807075781391858178889652208164348344825993266043367660176999612831860788386150279465955131156552036093988180612138558600301435694527224206344631797460594682573103790084024432438465657245014402821885252470935190620929023136493273497565513958720559654228749774011413346962715422845862377387538230483865688976461927383814900140767310446640259899490222221765904339901886018566526485061799702356193897017860040811889729918311021171229845901641921068884387121855646124960798722908519296819372388642614839657382291123125024186649353143970137428531926649875337218940694281434118520158014123344828015051399694290153483077644569099073152433278288269864602789864321139083506217095002597389863554277196742822248757586765752344220207573630569498825087968928162753848863396909959826280956121450994871701244516461260379029309120889086942028510640182154399457156805941872748998094254742173582401063677404595741785160829230135358081840096996372524230560855903700624271243416909004153690105933983835777939410970027753472000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'))\r\ntoc\r\n%%\r\ntic\r\nN=42;\r\ny = factorialJava(N);\r\nassert(strcmp(y,'1405006117752879898543142606244511569936384000000000'))\r\ntoc\r\n\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":47,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-08-30T01:59:14.000Z","updated_at":"2025-12-10T03:30:57.000Z","published_at":"2013-08-30T02:37:28.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis challenge is an application of java.math that allows unlimited precision calculations. The primary reference sites are\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Number.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eJava Math\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigDecimal.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eJava BigDecimal\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigInteger.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eJava BigInteger\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe usage of BigDecimal function multiply will be essential.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eJava Math tutorial: (Simplified summary that is believed correct)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[vd-decimal value, vstr-string, vi-integer value \\nxBD=java.math.BigDecimal(vd);  % valid vd,vstr,vi creates xBD a BigDecimal variable\\nimport java.math.*;  % simplifies statements\\nxBD=BigDecimal(vstr);\\n\\nxmultiplyzBD=xBD.multiply(BigDecimal(z));  % multiply input requires BD type\\n\\nTo convert java to string of unlimited length can be achieved via java toString or Matlab char\\n\\nxstr=toString(xBD)  or xstr=char(xBD)]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eInput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e N [1\u0026lt; N \u0026lt; 1000]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Y (char variable of Y=N! or a BigDecimal variable)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.nitrxgen.net/factorialcalc.php\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eFactorial Calculator\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eRelated Challenges:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/1833-usage-of-java-math-add-multiply-pow\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e1. Usage of java math\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[2. nchoosek_large (full precision)\\n2. Next Prime\\n3. factor_large\\n4. Factorial]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":55715,"title":"AZPC Oddly Triangular: N=35/305 using Digits 3/7/9  Part 5 of 5","description":"AZPC created the Oddly Triangular contest on 9/7/22. The challenge is to find the longest sequence of N odd digits such that sum(1:value)  is composed of only odd digits. The contest ended on 9/8/22 as Rokicki created a 3.6 million digit solution with the implication that an infinite length pattern had been determined. [N=2, 17, sum(1:17)=153]\r\nPart 5 is a generalization of multiple solutions to find Rokicki's result.\r\nReviewing the N=8/11/14 3/7/9 solutions determine a form such that N=5+3*n.\r\nThe values 397979797973 and 399799799799799733 has N=6+6*n given the generalization of  3[1]9[n]7[1]9[n]7[1]9[n]7[1]9[n]7[1]9[n]7[1]3[n]\r\nUsage of matlab java math can be seen in the Test Suite. A function zcombvec is given in the function template to facilitate creation of all vectors that only use the 3/7/9 digits. Usage of zcombvec is not required.\r\nM=OddlyTri5p3n_379(N) where N=digit length, M is a string of length N.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 255px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 127.5px; transform-origin: 407px 127.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eAZPC\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 40px 8px; transform-origin: 40px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e created the \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eOddly Triangular\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 270.5px 8px; transform-origin: 270.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e contest on 9/7/22. The challenge is to find the longest sequence of N odd digits such that sum(1:value)  is composed of only odd digits. The contest ended on 9/8/22 as Rokicki created a 3.6 million digit solution with the implication that an infinite length pattern had been determined. [N=2, 17, sum(1:17)=153]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 214.5px 8px; transform-origin: 214.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ePart 5 is a generalization of multiple solutions to find Rokicki's result.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 243.5px 8px; transform-origin: 243.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eReviewing the N=8/11/14 3/7/9 solutions determine a form such that N=5+3*n.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 304.5px 8px; transform-origin: 304.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe values 397979797973 and 399799799799799733 has N=6+6*n given the generalization of  3[1]9[n]7[1]9[n]7[1]9[n]7[1]9[n]7[1]9[n]7[1]3[n]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 384px 8px; transform-origin: 384px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eUsage of matlab java math can be seen in the Test Suite. A function zcombvec is given in the function template to facilitate creation of all vectors that only use the 3/7/9 digits. Usage of zcombvec is not required.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 223.5px 8px; transform-origin: 223.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eM=OddlyTri5p3n_379(N) where N=digit length, M is a string of length N.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function M=OddlyTri5p3n_379(N)\r\n% M needs to be a string of length N\r\n M='339';\r\n  \r\nend","test_suite":"%%\r\nimport java.math.*\r\nBD1=BigDecimal(1); % Create a BigDecimal Constant\r\nBD2=BigDecimal(2);\r\ntic\r\nN = 35;\r\n\r\nM=OddlyTri5p3n_379(N) % M is a string\r\nvalid=length(M)==N;\r\n if nnz(M=='0')\u003e0,valid=0;end % Check for any Even digits in M\r\n if nnz(M=='2')\u003e0,valid=0;end\r\n if nnz(M=='4')\u003e0,valid=0;end\r\n if nnz(M=='6')\u003e0,valid=0;end\r\n if nnz(M=='8')\u003e0,valid=0;end\r\n   \r\n if valid % Now calc sums using java math infinite precision\r\n   numval=BigDecimal(M); % M\r\n   numval1=numval.add(BD1); % M+1\r\n   numval1d2=numval1.divide(BD2); %(M+1)/2\r\n   m1m2=numval.multiply(numval1d2); %M*(M+1)/2\r\n   Msum=char(m1m2); %Convert Java variable to a string\r\n   if nnz(Msum=='0')\u003e0,valid=0;end % Check for any Even digits in sum\r\n   if nnz(Msum=='2')\u003e0,valid=0;end\r\n   if nnz(Msum=='4')\u003e0,valid=0;end\r\n   if nnz(Msum=='6')\u003e0,valid=0;end\r\n   if nnz(Msum=='8')\u003e0,valid=0;end\r\n end\r\n\r\n\r\nif valid\r\n fprintf('Valid set\\n')\r\n fprintf('%s %s\\n',M,Msum)\r\nelse\r\n fprintf('Not Valid: \\n')\r\n fprintf('%s %s\\n',M,Msum)\r\nend\r\n\r\nassert(isequal(valid,1))\r\ntoc\r\n%%\r\nimport java.math.*\r\nBD1=BigDecimal(1); % Create a BigDecimal Constant\r\nBD2=BigDecimal(2);\r\ntic\r\nN = 305;\r\n\r\nM=OddlyTri5p3n_379(N) % M is a string\r\nvalid=length(M)==N;\r\n if nnz(M=='0')\u003e0,valid=0;end % Check for any Even digits in M\r\n if nnz(M=='2')\u003e0,valid=0;end\r\n if nnz(M=='4')\u003e0,valid=0;end\r\n if nnz(M=='6')\u003e0,valid=0;end\r\n if nnz(M=='8')\u003e0,valid=0;end\r\n   \r\n if valid % Now calc sums using java math infinite precision\r\n   numval=BigDecimal(M); % M\r\n   numval1=numval.add(BD1); % M+1\r\n   numval1d2=numval1.divide(BD2); %(M+1)/2\r\n   m1m2=numval.multiply(numval1d2); %M*(M+1)/2\r\n   Msum=char(m1m2); %Convert Java variable to a string\r\n   if nnz(Msum=='0')\u003e0,valid=0;end % Check for any Even digits in sum\r\n   if nnz(Msum=='2')\u003e0,valid=0;end\r\n   if nnz(Msum=='4')\u003e0,valid=0;end\r\n   if nnz(Msum=='6')\u003e0,valid=0;end\r\n   if nnz(Msum=='8')\u003e0,valid=0;end\r\n end\r\n\r\n\r\nif valid\r\n fprintf('Valid set\\n')\r\n for i=1:50:length(M)\r\n  fprintf('%s\\n',M(i:min(length(M),i+49)))\r\n end\r\n fprintf('\\n')\r\n for i=1:50:length(Msum)\r\n  fprintf('%s\\n',Msum(i:min(length(Msum),i+49)))\r\n end\r\nelse\r\n fprintf('Not Valid: \\n')\r\n for i=1:50:length(M)\r\n  fprintf('%s\\n',M(i:min(length(M),i+49)))\r\n end\r\n fprintf('\\n')\r\n for i=1:50:length(Msum)\r\n  fprintf('%s\\n',Msum(i:min(length(Msum),i+49)))\r\n end\r\nend\r\n\r\nassert(isequal(valid,1))\r\ntoc\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":3097,"edited_by":3097,"edited_at":"2022-09-14T03:38:06.000Z","deleted_by":null,"deleted_at":null,"solvers_count":5,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2022-09-14T03:11:12.000Z","updated_at":"2022-09-14T03:38:07.000Z","published_at":"2022-09-14T03:38:07.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eAZPC\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e created the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eOddly Triangular\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e contest on 9/7/22. The challenge is to find the longest sequence of N odd digits such that sum(1:value)  is composed of only odd digits. The contest ended on 9/8/22 as Rokicki created a 3.6 million digit solution with the implication that an infinite length pattern had been determined. [N=2, 17, sum(1:17)=153]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePart 5 is a generalization of multiple solutions to find Rokicki's result.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eReviewing the N=8/11/14 3/7/9 solutions determine a form such that N=5+3*n.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe values 397979797973 and 399799799799799733 has N=6+6*n given the generalization of  3[1]9[n]7[1]9[n]7[1]9[n]7[1]9[n]7[1]9[n]7[1]3[n]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eUsage of matlab java math can be seen in the Test Suite. A function zcombvec is given in the function template to facilitate creation of all vectors that only use the 3/7/9 digits. Usage of zcombvec is not required.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eM=OddlyTri5p3n_379(N) where N=digit length, M is a string of length N.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":55710,"title":"AZPC Oddly Triangular: N=34/304 using Digits 3/7/9  Part 4 of 5","description":"AZPC created the Oddly Triangular contest on 9/7/22. The challenge is to find the longest sequence of N odd digits such that sum(1:value)  is composed of only odd digits. The contest ended on 9/8/22 as Rokicki created a 3.6 million digit solution with the implication that an infinite length pattern had been determined. [N=2, 17, sum(1:17)=153]\r\nPart 4 is the generalization of multiple solutions to find Rokicki's result.\r\nReviewing the N=7/10/13 3/7/9 solutions determine a form such that N=4+3*n.\r\nThe values 397979797973 and 399799799799799733 has N=6+6*n given the generalization of  3[1]9[n]7[1]9[n]7[1]9[n]7[1]9[n]7[1]9[n]7[1]3[n]\r\nUsage of matlab java math can be seen in the Test Suite. A function zcombvec is given in the function template to facilitate creation of all vectors that only use the 3/7/9 digits. Usage of zcombvec is not required.\r\nM=OddlyTri4p3n_379(N) where N=digit length, M is a string of length N.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 255px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 127.5px; transform-origin: 407px 127.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eAZPC\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 40px 8px; transform-origin: 40px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e created the \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eOddly Triangular\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 270.5px 8px; transform-origin: 270.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e contest on 9/7/22. The challenge is to find the longest sequence of N odd digits such that sum(1:value)  is composed of only odd digits. The contest ended on 9/8/22 as Rokicki created a 3.6 million digit solution with the implication that an infinite length pattern had been determined. [N=2, 17, sum(1:17)=153]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 220.5px 8px; transform-origin: 220.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ePart 4 is the generalization of multiple solutions to find Rokicki's result.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 244px 8px; transform-origin: 244px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eReviewing the N=7/10/13 3/7/9 solutions determine a form such that N=4+3*n.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 304.5px 8px; transform-origin: 304.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe values 397979797973 and 399799799799799733 has N=6+6*n given the generalization of  3[1]9[n]7[1]9[n]7[1]9[n]7[1]9[n]7[1]9[n]7[1]3[n]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 384px 8px; transform-origin: 384px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eUsage of matlab java math can be seen in the Test Suite. A function zcombvec is given in the function template to facilitate creation of all vectors that only use the 3/7/9 digits. Usage of zcombvec is not required.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 223.5px 8px; transform-origin: 223.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eM=OddlyTri4p3n_379(N) where N=digit length, M is a string of length N.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function M=OddlyTri4p3n_379(N)\r\n% M needs to be a string of length N\r\n M='339';\r\n  \r\nend","test_suite":"%%\r\nimport java.math.*\r\nBD1=BigDecimal(1); % Create a BigDecimal Constant\r\nBD2=BigDecimal(2);\r\ntic\r\nN = 34;\r\n\r\nM=OddlyTri4p3n_379(N) % M is a string\r\nvalid=length(M)==N;\r\n if nnz(M=='0')\u003e0,valid=0;end % Check for any Even digits in M\r\n if nnz(M=='2')\u003e0,valid=0;end\r\n if nnz(M=='4')\u003e0,valid=0;end\r\n if nnz(M=='6')\u003e0,valid=0;end\r\n if nnz(M=='8')\u003e0,valid=0;end\r\n   \r\n if valid % Now calc sums using java math infinite precision\r\n   numval=BigDecimal(M); % M\r\n   numval1=numval.add(BD1); % M+1\r\n   numval1d2=numval1.divide(BD2); %(M+1)/2\r\n   m1m2=numval.multiply(numval1d2); %M*(M+1)/2\r\n   Msum=char(m1m2); %Convert Java variable to a string\r\n   if nnz(Msum=='0')\u003e0,valid=0;end % Check for any Even digits in sum\r\n   if nnz(Msum=='2')\u003e0,valid=0;end\r\n   if nnz(Msum=='4')\u003e0,valid=0;end\r\n   if nnz(Msum=='6')\u003e0,valid=0;end\r\n   if nnz(Msum=='8')\u003e0,valid=0;end\r\n end\r\n\r\n\r\nif valid\r\n fprintf('Valid set\\n')\r\n fprintf('%s %s\\n',M,Msum)\r\nelse\r\n fprintf('Not Valid: \\n')\r\n fprintf('%s %s\\n',M,Msum)\r\nend\r\n\r\nassert(isequal(valid,1))\r\ntoc\r\n%%\r\nimport java.math.*\r\nBD1=BigDecimal(1); % Create a BigDecimal Constant\r\nBD2=BigDecimal(2);\r\ntic\r\nN = 304;\r\n\r\nM=OddlyTri4p3n_379(N) % M is a string\r\nvalid=length(M)==N;\r\n if nnz(M=='0')\u003e0,valid=0;end % Check for any Even digits in M\r\n if nnz(M=='2')\u003e0,valid=0;end\r\n if nnz(M=='4')\u003e0,valid=0;end\r\n if nnz(M=='6')\u003e0,valid=0;end\r\n if nnz(M=='8')\u003e0,valid=0;end\r\n   \r\n if valid % Now calc sums using java math infinite precision\r\n   numval=BigDecimal(M); % M\r\n   numval1=numval.add(BD1); % M+1\r\n   numval1d2=numval1.divide(BD2); %(M+1)/2\r\n   m1m2=numval.multiply(numval1d2); %M*(M+1)/2\r\n   Msum=char(m1m2); %Convert Java variable to a string\r\n   if nnz(Msum=='0')\u003e0,valid=0;end % Check for any Even digits in sum\r\n   if nnz(Msum=='2')\u003e0,valid=0;end\r\n   if nnz(Msum=='4')\u003e0,valid=0;end\r\n   if nnz(Msum=='6')\u003e0,valid=0;end\r\n   if nnz(Msum=='8')\u003e0,valid=0;end\r\n end\r\n\r\n\r\nif valid\r\n fprintf('Valid set\\n')\r\n for i=1:50:length(M)\r\n  fprintf('%s\\n',M(i:min(length(M),i+49)))\r\n end\r\n fprintf('\\n')\r\n for i=1:50:length(Msum)\r\n  fprintf('%s\\n',Msum(i:min(length(Msum),i+49)))\r\n end\r\nelse\r\n fprintf('Not Valid: \\n')\r\n for i=1:50:length(M)\r\n  fprintf('%s\\n',M(i:min(length(M),i+49)))\r\n end\r\n fprintf('\\n')\r\n for i=1:50:length(Msum)\r\n  fprintf('%s\\n',Msum(i:min(length(Msum),i+49)))\r\n end\r\nend\r\n\r\nassert(isequal(valid,1))\r\ntoc","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":3097,"edited_by":3097,"edited_at":"2022-09-14T03:36:05.000Z","deleted_by":null,"deleted_at":null,"solvers_count":5,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2022-09-14T02:51:43.000Z","updated_at":"2022-09-14T03:36:05.000Z","published_at":"2022-09-14T03:36:05.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eAZPC\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e created the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eOddly Triangular\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e contest on 9/7/22. The challenge is to find the longest sequence of N odd digits such that sum(1:value)  is composed of only odd digits. The contest ended on 9/8/22 as Rokicki created a 3.6 million digit solution with the implication that an infinite length pattern had been determined. [N=2, 17, sum(1:17)=153]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePart 4 is the generalization of multiple solutions to find Rokicki's result.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eReviewing the N=7/10/13 3/7/9 solutions determine a form such that N=4+3*n.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe values 397979797973 and 399799799799799733 has N=6+6*n given the generalization of  3[1]9[n]7[1]9[n]7[1]9[n]7[1]9[n]7[1]9[n]7[1]3[n]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eUsage of matlab java math can be seen in the Test Suite. A function zcombvec is given in the function template to facilitate creation of all vectors that only use the 3/7/9 digits. Usage of zcombvec is not required.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eM=OddlyTri4p3n_379(N) where N=digit length, M is a string of length N.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":1833,"title":"Usage of java.math : Add, Multiply, Pow","description":"This challenge is an introduction to the wonderful word of java.math that allows unlimited precision calculations.  The primary reference sites are \u003chttp://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Number.html Java Math\u003e, \u003chttp://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigDecimal.html Java BigDecimal\u003e, and \u003chttp://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigInteger.html Java BigInteger\u003e.\r\n\r\nThe usage of BigDecimal functions add, multiply, and pow will be tested.\r\n\r\nJava Math tutorial: (Simplified summary that is believed correct)\r\n\r\n  vd-decimal value, vstr-string, vi-integer value \r\n  xBD=java.math.BigDecimal(vd);  % valid vd,vstr,vi creates xBD a BigDecimal variable\r\n  import java.math.*;  % simplifies statements\r\n  xBD=BigDecimal(vstr);\r\n  x2pwrBD=xBD.pow(vi); % Invalid: vd,vstr,BD\r\n  xplusyBD=xBD.add(BigDecimal(y)); % add input requires BD type\r\n  xmultiplyzBD=xBD.multiply(BigDecimal(z));  % multiply input requires BD type\r\n  \r\n  To convert java to string of unlimited length can be achieved via java toString or Matlab char\r\n  \r\n  xstr=toString(xBD)  or xstr=char(xBD) \r\n\r\n*Input:* X,Y, function_case  [X,Y double or str, function 1:X+Y, 2:X*Y, 3: X^Y(double)\r\n\r\n*Output:* z  (char variable)\r\n\r\n*Future Challenges:*\r\n\r\n  1. nchoosek_large (full precision)\r\n  2. Next Prime\r\n  3. factor_large\r\n\r\n4. \u003chttp://www.mathworks.com/matlabcentral/cody/problems/1854-factorial-unlimited-size-java-math Factorial\u003e","description_html":"\u003cp\u003eThis challenge is an introduction to the wonderful word of java.math that allows unlimited precision calculations.  The primary reference sites are \u003ca href = \"http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Number.html\"\u003eJava Math\u003c/a\u003e, \u003ca href = \"http://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigDecimal.html\"\u003eJava BigDecimal\u003c/a\u003e, and \u003ca href = \"http://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigInteger.html\"\u003eJava BigInteger\u003c/a\u003e.\u003c/p\u003e\u003cp\u003eThe usage of BigDecimal functions add, multiply, and pow will be tested.\u003c/p\u003e\u003cp\u003eJava Math tutorial: (Simplified summary that is believed correct)\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003evd-decimal value, vstr-string, vi-integer value \r\nxBD=java.math.BigDecimal(vd);  % valid vd,vstr,vi creates xBD a BigDecimal variable\r\nimport java.math.*;  % simplifies statements\r\nxBD=BigDecimal(vstr);\r\nx2pwrBD=xBD.pow(vi); % Invalid: vd,vstr,BD\r\nxplusyBD=xBD.add(BigDecimal(y)); % add input requires BD type\r\nxmultiplyzBD=xBD.multiply(BigDecimal(z));  % multiply input requires BD type\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eTo convert java to string of unlimited length can be achieved via java toString or Matlab char\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003exstr=toString(xBD)  or xstr=char(xBD) \r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003eInput:\u003c/b\u003e X,Y, function_case  [X,Y double or str, function 1:X+Y, 2:X*Y, 3: X^Y(double)\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput:\u003c/b\u003e z  (char variable)\u003c/p\u003e\u003cp\u003e\u003cb\u003eFuture Challenges:\u003c/b\u003e\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e1. nchoosek_large (full precision)\r\n2. Next Prime\r\n3. factor_large\r\n\u003c/pre\u003e\u003cp\u003e4. \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/1854-factorial-unlimited-size-java-math\"\u003eFactorial\u003c/a\u003e\u003c/p\u003e","function_template":"function zstr=java_math(x,y,select)\r\n import java.math.*\r\n\r\n switch select\r\n    case 1 % add x+y\r\n     zBD=x+y;\r\n    case 2 % multiply  x*y\r\n     zBD=x*y;\r\n    case 3 % power  x^y\r\n     zBD=x^y;\r\n     \r\n end\r\n zstr=char(zBD);\r\n\r\nend","test_suite":"%%\r\nx=2;\r\ny=64;\r\n% power\r\nzstr=java_math(x,y,3);\r\nassert(strcmp(zstr,'18446744073709551616'),sprintf('zstr=%s\\n',zstr))\r\n%%\r\nxstr='18446744073709551615';\r\ny=3;\r\n%Add\r\nzstr=java_math(xstr,y,1);\r\nassert(strcmp(zstr,'18446744073709551618'),sprintf('zstr=%s\\n',zstr))\r\n%%\r\nx=2^53;  % largest eps==1 double\r\ny=2^11;\r\n%Multiply\r\nzstr=java_math(x,y,2);\r\nassert(strcmp(zstr,'18446744073709551616'),sprintf('zstr=%s\\n',zstr))\r\n%%\r\nx=2^53;  % largest valid double\r\ny=2^12;\r\n% Multiply\r\nzstr=java_math(x,y,2);\r\nassert(strcmp(zstr,'36893488147419103232'),sprintf('zstr=%s\\n',zstr))\r\n%%\r\nx=randi(10);\r\ny=randi(100);\r\nzstr=java_math(x,y,1);\r\nassert(strcmp(zstr,num2str(x+y)),sprintf('x=%2i y=%3i x+y=%5i zstr=%s\\n',x,y,x+y,zstr))\r\n%%\r\nx=randi(10);\r\ny=randi(100);\r\nzstr=java_math(x,y,2);\r\nassert(strcmp(zstr,num2str(x*y)),sprintf('x=%2i y=%3i x*y=%5i zstr=%s\\n',x,y,x*y,zstr))\r\n%%\r\nx=randi(20);\r\ny=randi(5);\r\nzstr=java_math(x,y,3);\r\nassert(strcmp(zstr,num2str(x^y)),sprintf('x=%2i y=%3i x^y=%8i zstr=%s\\n',x,y,x^y,zstr))\r\n\r\n\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":3,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":37,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-08-18T17:42:26.000Z","updated_at":"2025-12-10T01:06:03.000Z","published_at":"2013-08-18T19:02:27.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis challenge is an introduction to the wonderful word of java.math that allows unlimited precision calculations. The primary reference sites are\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Number.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eJava Math\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigDecimal.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eJava BigDecimal\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigInteger.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eJava BigInteger\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe usage of BigDecimal functions add, multiply, and pow will be tested.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eJava Math tutorial: (Simplified summary that is believed correct)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[vd-decimal value, vstr-string, vi-integer value \\nxBD=java.math.BigDecimal(vd);  % valid vd,vstr,vi creates xBD a BigDecimal variable\\nimport java.math.*;  % simplifies statements\\nxBD=BigDecimal(vstr);\\nx2pwrBD=xBD.pow(vi); % Invalid: vd,vstr,BD\\nxplusyBD=xBD.add(BigDecimal(y)); % add input requires BD type\\nxmultiplyzBD=xBD.multiply(BigDecimal(z));  % multiply input requires BD type\\n\\nTo convert java to string of unlimited length can be achieved via java toString or Matlab char\\n\\nxstr=toString(xBD)  or xstr=char(xBD)]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eInput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e X,Y, function_case [X,Y double or str, function 1:X+Y, 2:X*Y, 3: X^Y(double)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e z (char variable)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eFuture Challenges:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[1. nchoosek_large (full precision)\\n2. Next Prime\\n3. factor_large]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e4.\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/1854-factorial-unlimited-size-java-math\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eFactorial\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":1855,"title":"Usage of java.math : N Choose K with unlimited precision","description":"Calculate the binomial coefficient nchoosek with full accuracy. This challenge may use the wonderful word of java.math that allows unlimited precision calculations.  The primary reference sites are \u003chttp://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Number.html Java Math\u003e, \u003chttp://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigDecimal.html Java BigDecimal\u003e, and \u003chttp://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigInteger.html Java BigInteger\u003e.\r\n\r\nThe usage of BigDecimal functions add, multiply, and divide may be required.\r\n\r\nJava Math:\r\n\r\n  vd-decimal value, vstr-string, vi-integer value \r\n  xBD=java.math.BigDecimal(vd);  % valid vd,vstr,vi creates xBD a BigDecimal variable\r\n  import java.math.*;  % simplifies statements\r\n  xBD=BigDecimal(vstr);\r\n  xplusyBD=xBD.add(BigDecimal(y)); % add input requires BD type\r\n  xmultiplyzBD=xBD.multiply(BigDecimal(z));  % multiply input requires BD type\r\n  xdividezBD=xBD.divide(BigDecimal(z));  % divide input requires BD type\r\n  xmultydivz=xBD.multiply(yBD).divide(zBD);  out=x*y/z\r\n  \r\n  To convert java to string of unlimited length can be achieved via java toString or Matlab char\r\n  \r\n  xstr=toString(xBD)  or xstr=char(xBD) \r\n\r\n*Input:* [N,K]  [ Inputs to nchoosek(N,K) 0\u003c=K\u003c=N\u003c200 ]\r\n\r\n*Output:* C  (char variable of C=nchoosek(n,k) or BigDecimal variable type )\r\n\r\n*Theory:*\r\n\r\n\u003chttp://en.wikipedia.org/wiki/Binomial_coefficient C(n,k)\u003e link shows multiple evaluation methods.\r\n\r\nC(n,k)= n!/(k!(n-k)!)\r\n\r\n\u003c\u003chttp://upload.wikimedia.org/math/b/1/a/b1a5828ee5ec18a1362999a76f3c63e6.png\u003e\u003e\r\n\r\nThe factorial method gives a direct solution while the multiplicative may require fewer operations. \r\n\r\n*Hint:* C(5,3)=(5/3)*(4/2)*(3/1)= (5/1)*(4/2)*(3/3); numerator has k terms\r\n\r\n*Future Challenges:*\r\n\r\n1. \u003chttp://www.mathworks.com/matlabcentral/cody/problems/1833-usage-of-java-math-add-multiply-pow Usage of java.math\u003e\r\n\r\n  2. nchoosek_large (full precision)\r\n  3. Next Prime\r\n  4. factor_large\r\n\r\n5. \u003chttp://www.mathworks.com/matlabcentral/cody/problems/1854-factorial-unlimited-size-java-math Factorial\u003e","description_html":"\u003cp\u003eCalculate the binomial coefficient nchoosek with full accuracy. This challenge may use the wonderful word of java.math that allows unlimited precision calculations.  The primary reference sites are \u003ca href = \"http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Number.html\"\u003eJava Math\u003c/a\u003e, \u003ca href = \"http://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigDecimal.html\"\u003eJava BigDecimal\u003c/a\u003e, and \u003ca href = \"http://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigInteger.html\"\u003eJava BigInteger\u003c/a\u003e.\u003c/p\u003e\u003cp\u003eThe usage of BigDecimal functions add, multiply, and divide may be required.\u003c/p\u003e\u003cp\u003eJava Math:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003evd-decimal value, vstr-string, vi-integer value \r\nxBD=java.math.BigDecimal(vd);  % valid vd,vstr,vi creates xBD a BigDecimal variable\r\nimport java.math.*;  % simplifies statements\r\nxBD=BigDecimal(vstr);\r\nxplusyBD=xBD.add(BigDecimal(y)); % add input requires BD type\r\nxmultiplyzBD=xBD.multiply(BigDecimal(z));  % multiply input requires BD type\r\nxdividezBD=xBD.divide(BigDecimal(z));  % divide input requires BD type\r\nxmultydivz=xBD.multiply(yBD).divide(zBD);  out=x*y/z\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eTo convert java to string of unlimited length can be achieved via java toString or Matlab char\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003exstr=toString(xBD)  or xstr=char(xBD) \r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003eInput:\u003c/b\u003e [N,K]  [ Inputs to nchoosek(N,K) 0\u0026lt;=K\u0026lt;=N\u0026lt;200 ]\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput:\u003c/b\u003e C  (char variable of C=nchoosek(n,k) or BigDecimal variable type )\u003c/p\u003e\u003cp\u003e\u003cb\u003eTheory:\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://en.wikipedia.org/wiki/Binomial_coefficient\"\u003eC(n,k)\u003c/a\u003e link shows multiple evaluation methods.\u003c/p\u003e\u003cp\u003eC(n,k)= n!/(k!(n-k)!)\u003c/p\u003e\u003cimg src = \"http://upload.wikimedia.org/math/b/1/a/b1a5828ee5ec18a1362999a76f3c63e6.png\"\u003e\u003cp\u003eThe factorial method gives a direct solution while the multiplicative may require fewer operations.\u003c/p\u003e\u003cp\u003e\u003cb\u003eHint:\u003c/b\u003e C(5,3)=(5/3)*(4/2)*(3/1)= (5/1)*(4/2)*(3/3); numerator has k terms\u003c/p\u003e\u003cp\u003e\u003cb\u003eFuture Challenges:\u003c/b\u003e\u003c/p\u003e\u003cp\u003e1. \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/1833-usage-of-java-math-add-multiply-pow\"\u003eUsage of java.math\u003c/a\u003e\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e2. nchoosek_large (full precision)\r\n3. Next Prime\r\n4. factor_large\r\n\u003c/pre\u003e\u003cp\u003e5. \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/1854-factorial-unlimited-size-java-math\"\u003eFactorial\u003c/a\u003e\u003c/p\u003e","function_template":"function y = nchoosekJava(N,K)\r\n  y = num2str(nchoosek(N,K));\r\nend","test_suite":"%%\r\ntic\r\nN=5;K=2;\r\nNK=nchoosekJava(N,K);\r\ntoc\r\nassert(strcmp(NK,num2str(nchoosek(N,K))))\r\n%%\r\ntic\r\nN=randi(10);\r\nK=randi(N);\r\nNK=nchoosekJava(N,K);\r\ntoc\r\nassert(strcmp(NK,num2str(nchoosek(N,K))))\r\n%%\r\ntic\r\nN=100;\r\nK=50;\r\nNK=nchoosekJava(N,K);\r\ntoc\r\nassert(strcmp(NK,'100891344545564193334812497256'))\r\n%%\r\ntic\r\nN=200;\r\nK=75;\r\nNK=nchoosekJava(N,K);\r\ntoc\r\nassert(strcmp(NK,'168849997346404286704489530268603459022868706883102845056'))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":52,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-08-30T03:09:06.000Z","updated_at":"2026-02-08T19:48:26.000Z","published_at":"2013-08-30T03:48:17.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/media/image1.png\"}],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCalculate the binomial coefficient nchoosek with full accuracy. This challenge may use the wonderful word of java.math that allows unlimited precision calculations. The primary reference sites are\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Number.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eJava Math\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigDecimal.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eJava BigDecimal\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigInteger.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eJava BigInteger\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe usage of BigDecimal functions add, multiply, and divide may be required.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eJava Math:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[vd-decimal value, vstr-string, vi-integer value \\nxBD=java.math.BigDecimal(vd);  % valid vd,vstr,vi creates xBD a BigDecimal variable\\nimport java.math.*;  % simplifies statements\\nxBD=BigDecimal(vstr);\\nxplusyBD=xBD.add(BigDecimal(y)); % add input requires BD type\\nxmultiplyzBD=xBD.multiply(BigDecimal(z));  % multiply input requires BD type\\nxdividezBD=xBD.divide(BigDecimal(z));  % divide input requires BD type\\nxmultydivz=xBD.multiply(yBD).divide(zBD);  out=x*y/z\\n\\nTo convert java to string of unlimited length can be achieved via java toString or Matlab char\\n\\nxstr=toString(xBD)  or xstr=char(xBD)]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eInput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e [N,K] [ Inputs to nchoosek(N,K) 0\u0026lt;=K\u0026lt;=N\u0026lt;200 ]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e C (char variable of C=nchoosek(n,k) or BigDecimal variable type )\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eTheory:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://en.wikipedia.org/wiki/Binomial_coefficient\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eC(n,k)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e link shows multiple evaluation methods.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eC(n,k)= n!/(k!(n-k)!)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe factorial method gives a direct solution while the multiplicative may require fewer operations.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eHint:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e C(5,3)=(5/3)*(4/2)*(3/1)= (5/1)*(4/2)*(3/3); numerator has k terms\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eFuture Challenges:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e1.\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/1833-usage-of-java-math-add-multiply-pow\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUsage of java.math\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[2. nchoosek_large (full precision)\\n3. Next Prime\\n4. factor_large]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e5.\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/1854-factorial-unlimited-size-java-math\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eFactorial\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"},{\"partUri\":\"/media/image1.png\",\"contentType\":\"image/png\",\"content\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAiQAAAA6BAMAAABynl+BAAAAMFBMVEX///9iYmIEBASenp5AQEAwMDCKioq2trYiIiJ0dHQMDAzm5uYWFhZQUFDMzMwAAAAm8IwaAAAAAXRSTlMAQObYZgAACIxJREFUeNrtWmtsVMcVPnv3ce0uXtutCKW08aKoeRWSjairFJritCQ/EkRXalOaWA0kCqWgAAsCpIAqFvEjVaq0C1FABLXZKMqPqE1rU9OkqaLYNJES+lolQQgiipUoEaY1YIMB26y3M2fu3fs6M95ZbygyPtLdvd5v5juzZ2fOnDufASalRbphyrxW31Z9X2NyhqSUnAqJz0aWPjsVEq9t+V1yYgT94q1r8uSrz384sf6Jv4n3WLaqfHW9DNijhPdUzBXqVVCQNLBji/IbXz/ekF63XR6Wk9QtlyExEomzEEY7JLD5wdMWWhHXTwBOnpc5oGgAzjbWKyLC3CR+FfiNZ7i43rVvpjXJc86rsnz1Cb2Y2YxLpCXweqjrFmglXNjwgswBRQOJbMMeRUi4m0Z/9OM3WVwsvTa8Wt66ZlSRrzZQHx54lL0MhiXwv6D0TYFWwnWReTajMgcUDQxmz61ShIS7yfhDOXTU4drmTL0vV5Gv6Lwb5XmpVQLPZQMQaCVc03g6yUsdtOonT+7mSxTQas2SJU68Ps3JWNY/L8u7ipx8TAKzSR1GtCKun/Psk5c5IGjGLW25m9UyPohA7DaWbxoHnjn4Els5REgeOTNzzqz0mpb6iyTA60RxF+xaTBUYbJM79i1IDCNK1JxBrkEekmTn4x+TDggaapiB0nbDk7E3U+70Y7bnBJcBkQfYb9Z/90petJWIPH37B2YmmciN/ZIEINJk3wVteDmHbXLPqOYj6i9+SK67+cpvPzGXdkDQUMP0uzGjvz/nCWXpUsHiMmATa9/6xkzAkHUGGMPt7+XCVL4SAFxos++InbuNw2Vyd4K7B1Gf0VyPsWvfWGY97YCgoYbpcwMjHUdMz/56a7FgcYVgMS9aF/bAjXwhbesMzMJwf5Px8B/OYtsgkG8csO/Y5MMC5yCfpdGtbMGGFnZz2CY/jXN9On/9612IQryPJc83t1s3bi6n8Vk29KdiGZzdQQd4ecqFonN/R4EaHHdT98JSbOG4OdOTFlwR6OQx3Htz4jDf53Z8OxDmz+WgvycfAgkAHWn7Do6s5J//xdOKwRZ5AtHLuF382ob/zK7RXErcuLhcjePsWteS4WmOchBInpufGjnIbxaNbiw4w3T3ZW7Mk08+AZ4x9dn5JhLGIqgPSm9jiIO1M0u5/WnyARyBcymnySz/BCsgbJEP/rYMNOfNYY7C0PfZX/eCdePicjWex1a+MYBLj3CAl6e++MX8++7B8UV2ucfv9OVuMi2nwDumJRYfGCGcZ9+AYoEvrdK/g4txOfwjRK5SBOpy8iahNMI2uVNQb4EYov7UQHKxX3PkJcj+iXZA0HS4tiqKkLvZl74U9+Tl8KF6i8uI8cCEhyHaznfruksBt6kcPPAaFRIBjCbpJjxRRZs4XCYv2+btzW8h6jOaaz8vS4r5Y7QDgma88XM3q+HYmKfWieV2WVwGvsbSMHYjT2BDYwFKtke/v5TyJYBIB9Wk4aFWXu7mOFwmL9sfT5/+KqL+TZjkWsCA1MjOAu2AoBlv/NzNd2Fvgzcr1z9rc23zMv5dtxSM5+XYGiW8pkKu15UOCJplwyLXndUeMnIZSS++QzckQy/KsdlKeHaFXPellBSzoXZDRi6jzXveUOjVdbBJipj7VTCilXCZaRUFRVPtkC2u73k/fT6jyx+WpreoEo5WzHWHygFBM97CkY5JcBnzvJ8WtM9Yiw/LkN1KeHfFXId7FRS7qzhZlY1JcIUOeuvVhbN5bom8g0XdncFei3E37cpebefP7hEve87EWTLQVB3VSd9u34zUX5e17+qCq9LkI9a2gI6ThWvdIr6/Mzt9HzQ6SSokA/7PFlKBmsNkiy3iO/rJ+VfmQEiSSwZCV2su8X5H7WFGfM8m3dnMtZ5LIsd9HxSu8UwS/43hW2qpGoZEKVxqKqNXznYYOSzoy3pgR1BPRCx+iwarxbYiKREu16Iy+p2gConK6FpC0qz9cpWpeEPHjW4sVwezVppNJQONELus84gs2BKnAL4Y2OTXsSjU83LwRN7xatvqOVu7BeoL1fmarw9pGVc00mJUth64gGjEMbNOxyGyqYVLUoWUKKPxHyZrHZKhozLkeCTZgzf7PhUfzCIacayo9Tshm5nDE0Kv3R/dyl4/Yteqlx2vtvXD8GWB+p7mR69cLvmZURQr19ID44uJRhwb0polyKYWLkkVUqaMXknLG5fEoDfEm/leMxojGiE2V4cWe1jC5Veo9ZqyVEjhtWy2MvqZf+/EdPkhiGHgmbytB44NEwcriG3XcCh6qIVLUoWUKaN6lsZlZoIpb4Jypywk0RJ/s/VA6t+ABHaTxphED7VwSaqQMmVUawK0puNHOsB8BsLyCgflTln1OvQ0hnQsAzz7H3iB+M0Re0NnlmCPt9m3zRwBLjO5hEu08xloSJe9utFFdyHqKKP80rLzhwBufgLuXAHRn+6VffF3udwpfRL+pJdvlkIPhC8Q6VBgB3RCgj3GES4dFdKFBpVRVEd1bEw85/WoH/f60orDgX2PQFkPhHaqyEBMpzIQPdTCpUuFdKFBZfTezya/LlEdIZW+BmU9sP6fVJGBWF6nLMEeauGSVCFlymjNDeVOaUgu7oeyHhiaThYZDIu/rFWWcDa1cEmqkDJlNHDSNVFDuVMaEtjl6IE/oo6gBJbVcCh6qIVLUoWUKaOHX/xxR01DIuROqTl7XvyGWrpVC5dayqie/df+Yr3VhYutq/L/xY28UsuQqIVLLWVUz1qsxXGoeooN9qR8vLbP39K1ZvJ5+ZoSrcnqqHqWwE4rnYV/UNvn705p6cCrr/ubVOhEDvOWTDCS/CFso3WWUWMZQilc6imjOramLr6IWRtMWdmSE184k8zqJ3i2EJl8ISn1xeezPPWf7qn1Uk6v11m7RcuDU8Gojf0PBYku0k/USjQAAAAASUVORK5CYII=\"}]}"},{"id":55705,"title":"AZPC Oddly Triangular: N=10/11/13/14 Digits 3/7/9  Part 3 of 5","description":"AZPC created the Oddly Triangular contest on 9/7/22. The challenge is to find the longest sequence of N odd digits such that sum(1:value)  is composed of only odd digits. The contest ended on 9/8/22 as Rokicki created a 3.6 million digit solution with the implication that an infinite length pattern had been determined. [N=2, 17, sum(1:17)=153]\r\nThis is step three of the steps and processing types to find Rokicki's result.\r\nThis challenge is to find a solution subset with lengths 10, 11, 13, and 14 that only use the digits 3/7/9 in M and begin with 339 (10/11), 3399(13), and 33999(14). The sum(1:M(i)) may only use odd digits. Normal double variables will not suffice for N\u003e8 solutions as the eps is \u003e1 for the sums.\r\nUsage of matlab java math can be seen in the Test Suite. A function zcombvec is given in the function template to facilitate creation of all vectors that only use the 3/7/9 digits. Usage of zcombvec is not required.\r\nM=OddlyTri339_379(N,Q) where N=digit length, Q=number of solutions, M is a double vector of the Q values.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 246px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 123px; transform-origin: 407px 123px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eAZPC\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 40px 8px; transform-origin: 40px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e created the \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eOddly Triangular\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 270.5px 8px; transform-origin: 270.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e contest on 9/7/22. The challenge is to find the longest sequence of N odd digits such that sum(1:value)  is composed of only odd digits. The contest ended on 9/8/22 as Rokicki created a 3.6 million digit solution with the implication that an infinite length pattern had been determined. [N=2, 17, sum(1:17)=153]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 235.5px 8px; transform-origin: 235.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThis is step three of the steps and processing types to find Rokicki's result.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 384px 8px; transform-origin: 384px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThis challenge is to find a solution subset with lengths 10, 11, 13, and 14 that only use the digits 3/7/9 in M and begin with 339 (10/11), 3399(13), and 33999(14). The sum(1:M(i)) may only use odd digits. Normal double variables will not suffice for N\u0026gt;8 solutions as the eps is \u0026gt;1 for the sums.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 384px 8px; transform-origin: 384px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eUsage of matlab java math can be seen in the Test Suite. A function zcombvec is given in the function template to facilitate creation of all vectors that only use the 3/7/9 digits. Usage of zcombvec is not required.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 342px 8px; transform-origin: 342px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eM=OddlyTri339_379(N,Q) where N=digit length, Q=number of solutions, M is a double vector of the Q values.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function M=OddlyTri339_379(N,Q)\r\n% M starts with 339\r\n M=zeros(Q,1);\r\n  \r\nend\r\n\r\nfunction cc = zcombvec(old, new)\r\n% old: base matrix\r\n% new: column vector of new elements to augment combinations\r\n% cc: matrix of all combinations of old with new\r\n%{ \r\n Usage \r\n a=[3];\r\n b=[3;7;9];\r\n for ih=2:2\r\n  a=zcombvec(a,b);\r\n end\r\n results in [3 3;3 7; 3 9]\r\n%}\r\n mm = size(old,1);\r\n nn = size(new,1);\r\n cc = repmat(old, nn, 1);\r\n t=repmat(new', mm, 1);\r\n cc = [cc  t(:)];\r\nend %zcombvec\r\n\r\nfunction Nsum=sum1NJava(N)\r\n% 1+2+...+N= N*(N+1)/2  Nsum=sum(1:N)\r\n% N may be either string or real\r\n% No commas allowed in N if it is a string\r\n% Nsum char\r\n import java.math.*\r\n \r\n BD1=BigDecimal(1); % Create a BigDecimal Constant\r\n BD2=BigDecimal(2);\r\n \r\n numval=BigDecimal(N); % N\r\n numval1=numval.add(BD1); % N+1\r\n numval1d2=numval1.divide(BD2);\r\n m1m2=numval.multiply(numval1d2);\r\n Nsum=char(m1m2);\r\nend %sum1NJava","test_suite":"%%\r\nimport java.math.*\r\nBD1=BigDecimal(1); % Create a BigDecimal Constant\r\nBD2=BigDecimal(2);\r\ntic\r\nN = 10;\r\nQ = 1;\r\nvalid = 0;\r\nM=OddlyTri339_379(N,Q)\r\nM(M\u003c10^(N-1))=[]; %Verify digit lengths\r\nM(M\u003e=10^N)=[];\r\nM=unique(M);\r\nif length(M)==Q\r\n valid=prod(mod(prod(num2str(M)-'0',2),2));\r\n if valid % Now calc sums using java math infinite precision\r\n  numval=BigDecimal(M); % M\r\n  numval1=numval.add(BD1); % M+1\r\n  numval1d2=numval1.divide(BD2); %(M+1)/2\r\n  m1m2=numval.multiply(numval1d2); %M*(M+1)/2\r\n  Msum=char(m1m2); %Convert Java variable to a string\r\n  if nnz(Msum=='0')\u003e0,valid=0;end % Check for any Even digits in sum\r\n  if nnz(Msum=='2')\u003e0,valid=0;end\r\n  if nnz(Msum=='4')\u003e0,valid=0;end\r\n  if nnz(Msum=='6')\u003e0,valid=0;end\r\n  if nnz(Msum=='8')\u003e0,valid=0;end\r\n end\r\nend % length(M)==Q\r\nif valid\r\n fprintf('Valid set\\n')\r\n for i=1:length(M)\r\n  %fprintf('%i\\n',M(i))\r\n  fprintf('%i %s\\n',M(i),Msum)\r\n end\r\nelse\r\n fprintf('Not Valid set: Q %i required\\n',Q)\r\n for i=1:length(M)\r\n  fprintf('%i %s\\n',M(i),Msum)\r\n end\r\nend\r\n\r\nassert(isequal(valid,1))\r\ntoc\r\n%%\r\nimport java.math.*\r\nBD1=BigDecimal(1); % Create a BigDecimal Constant\r\nBD2=BigDecimal(2);\r\ntic\r\nN = 11;\r\nQ = 2;\r\nMsumc{Q}='';\r\nvalid = 0;\r\nM=OddlyTri339_379(N,Q)\r\nM(M\u003c10^(N-1))=[]; %Verify digit lengths\r\nM(M\u003e=10^N)=[];\r\nM=unique(M);\r\nif length(M)==Q\r\n valid=1;\r\n for i=1:Q\r\n  valid=valid*prod(mod(prod(num2str(M(i))-'0',2),2));\r\n  if valid % Now calc sums using java math infinite precision\r\n   numval=BigDecimal(M(i)); % M\r\n   numval1=numval.add(BD1); % M+1\r\n   numval1d2=numval1.divide(BD2); %(M+1)/2\r\n   m1m2=numval.multiply(numval1d2); %M*(M+1)/2\r\n   Msum=char(m1m2); %Convert Java variable to a string\r\n   if nnz(Msum=='0')\u003e0,valid=0;end % Check for any Even digits in sum\r\n   if nnz(Msum=='2')\u003e0,valid=0;end\r\n   if nnz(Msum=='4')\u003e0,valid=0;end\r\n   if nnz(Msum=='6')\u003e0,valid=0;end\r\n   if nnz(Msum=='8')\u003e0,valid=0;end\r\n   Msumc{i}=Msum;\r\n  end\r\n end % for i 1:Q\r\nend % length(M)==Q\r\nif valid\r\n fprintf('Valid set\\n')\r\n for i=1:length(M)\r\n  %fprintf('%i\\n',M(i))\r\n  fprintf('%i %s\\n',M(i),Msumc{i})\r\n end\r\nelse\r\n fprintf('Not Valid set: Q %i required\\n',Q)\r\n for i=1:length(M)\r\n  fprintf('%i %s\\n',M(i),Msumc{i})\r\n end\r\nend\r\n\r\nassert(isequal(valid,1))\r\ntoc\r\n%%\r\nimport java.math.*\r\nBD1=BigDecimal(1); % Create a BigDecimal Constant\r\nBD2=BigDecimal(2);\r\ntic\r\nN = 13;\r\nQ = 3;\r\nMsumc{Q}='';\r\nvalid = 0;\r\nM=OddlyTri339_379(N,Q)\r\nM(M\u003c10^(N-1))=[]; %Verify digit lengths\r\nM(M\u003e=10^N)=[];\r\nM=unique(M);\r\nif length(M)==Q\r\n valid=1;\r\n for i=1:Q\r\n  valid=valid*prod(mod(prod(num2str(M(i))-'0',2),2));\r\n  if valid % Now calc sums using java math infinite precision\r\n   numval=BigDecimal(M(i)); % M\r\n   numval1=numval.add(BD1); % M+1\r\n   numval1d2=numval1.divide(BD2); %(M+1)/2\r\n   m1m2=numval.multiply(numval1d2); %M*(M+1)/2\r\n   Msum=char(m1m2); %Convert Java variable to a string\r\n   if nnz(Msum=='0')\u003e0,valid=0;end % Check for any Even digits in sum\r\n   if nnz(Msum=='2')\u003e0,valid=0;end\r\n   if nnz(Msum=='4')\u003e0,valid=0;end\r\n   if nnz(Msum=='6')\u003e0,valid=0;end\r\n   if nnz(Msum=='8')\u003e0,valid=0;end\r\n   Msumc{i}=Msum;\r\n  end\r\n end % for i 1:Q\r\nend % length(M)==Q\r\nif valid\r\n fprintf('Valid set\\n')\r\n for i=1:length(M)\r\n  %fprintf('%i\\n',M(i))\r\n  fprintf('%i %s\\n',M(i),Msumc{i})\r\n end\r\nelse\r\n fprintf('Not Valid set: Q %i required\\n',Q)\r\n for i=1:length(M)\r\n  fprintf('%i %s\\n',M(i),Msumc{i})\r\n end\r\nend\r\n\r\nassert(isequal(valid,1))\r\ntoc\r\n%%\r\nimport java.math.*\r\nBD1=BigDecimal(1); % Create a BigDecimal Constant\r\nBD2=BigDecimal(2);\r\ntic\r\nN = 14;\r\nQ = 1;\r\nMsumc{Q}='';\r\nvalid = 0;\r\nM=OddlyTri339_379(N,Q)\r\nM(M\u003c10^(N-1))=[]; %Verify digit lengths\r\nM(M\u003e=10^N)=[];\r\nM=unique(M);\r\nif length(M)==Q\r\n valid=1;\r\n for i=1:Q\r\n  valid=valid*prod(mod(prod(num2str(M(i))-'0',2),2));\r\n  if valid % Now calc sums using java math infinite precision\r\n   numval=BigDecimal(M(i)); % M\r\n   numval1=numval.add(BD1); % M+1\r\n   numval1d2=numval1.divide(BD2); %(M+1)/2\r\n   m1m2=numval.multiply(numval1d2); %M*(M+1)/2\r\n   Msum=char(m1m2); %Convert Java variable to a string\r\n   if nnz(Msum=='0')\u003e0,valid=0;end % Check for any Even digits in sum\r\n   if nnz(Msum=='2')\u003e0,valid=0;end\r\n   if nnz(Msum=='4')\u003e0,valid=0;end\r\n   if nnz(Msum=='6')\u003e0,valid=0;end\r\n   if nnz(Msum=='8')\u003e0,valid=0;end\r\n   Msumc{i}=Msum;\r\n  end\r\n end % for i 1:Q\r\nend % length(M)==Q\r\nif valid\r\n fprintf('Valid set\\n')\r\n for i=1:length(M)\r\n  %fprintf('%i\\n',M(i))\r\n  fprintf('%i %s\\n',M(i),Msumc{i})\r\n end\r\nelse\r\n fprintf('Not Valid set: Q %i required\\n',Q)\r\n for i=1:length(M)\r\n  fprintf('%i %s\\n',M(i),Msumc{i})\r\n end\r\nend\r\n\r\nassert(isequal(valid,1))\r\ntoc","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":3097,"edited_by":3097,"edited_at":"2022-09-14T03:33:27.000Z","deleted_by":null,"deleted_at":null,"solvers_count":5,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2022-09-13T23:14:10.000Z","updated_at":"2022-09-14T03:33:28.000Z","published_at":"2022-09-14T03:33:28.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eAZPC\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e created the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eOddly Triangular\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e contest on 9/7/22. The challenge is to find the longest sequence of N odd digits such that sum(1:value)  is composed of only odd digits. The contest ended on 9/8/22 as Rokicki created a 3.6 million digit solution with the implication that an infinite length pattern had been determined. [N=2, 17, sum(1:17)=153]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis is step three of the steps and processing types to find Rokicki's result.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis challenge is to find a solution subset with lengths 10, 11, 13, and 14 that only use the digits 3/7/9 in M and begin with 339 (10/11), 3399(13), and 33999(14). The sum(1:M(i)) may only use odd digits. Normal double variables will not suffice for N\u0026gt;8 solutions as the eps is \u0026gt;1 for the sums.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eUsage of matlab java math can be seen in the Test Suite. A function zcombvec is given in the function template to facilitate creation of all vectors that only use the 3/7/9 digits. Usage of zcombvec is not required.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eM=OddlyTri339_379(N,Q) where N=digit length, Q=number of solutions, M is a double vector of the Q values.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":55695,"title":"AZPC Oddly Triangular: N=8/9 Digits 3/7/9  Part 2 of 5","description":"AZPC created the Oddly Triangular contest on 9/7/22. The challenge is to find the longest sequence of N odd digits such that sum(1:value)  is composed of only odd digits. The contest ended on 9/8/22 as Rokicki created a 3.6 million digit solution with the implication that an infinite length pattern had been determined. [N=2, 17, sum(1:17)=153]\r\nThis is step two of the steps and processing types to find Rokicki's result.\r\nThis challenge is to find a solution subset with lengths 8 and 9 that only use the digits 3/7/9 in M. The sum(1:M(i)) may only use odd digits. Normal double variables will not suffice for the N=9 solution as the eps is 8 for the sum. There are 8 length 8 solutions if all odd digits are allowed. Rokicki focused on patterns using only 3/7/9 to reduce his search space.\r\nUsage of matlab java math can be seen in the Test Suite. A function zcombvec is given in the function template to facilitate creation of all vectors that only use the 3/7/9 digits. Usage of zcombvec is not required.\r\nM=OddlyTri_379(N,Q) where N=digit length, Q=number of solutions, M is a double vector of the Q values.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 246px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 123px; transform-origin: 407px 123px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eAZPC\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 40px 8px; transform-origin: 40px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e created the \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eOddly Triangular\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 270.5px 8px; transform-origin: 270.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e contest on 9/7/22. The challenge is to find the longest sequence of N odd digits such that sum(1:value)  is composed of only odd digits. The contest ended on 9/8/22 as Rokicki created a 3.6 million digit solution with the implication that an infinite length pattern had been determined. [N=2, 17, sum(1:17)=153]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 229.5px 8px; transform-origin: 229.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThis is step two of the steps and processing types to find Rokicki's result.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 372.5px 8px; transform-origin: 372.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThis challenge is to find a solution subset with lengths 8 and 9 that only use the digits 3/7/9 in M. The sum(1:M(i)) may only use odd digits. Normal double variables will not suffice for the N=9 solution as the eps is 8 for the sum. There are 8 length 8 solutions if all odd digits are allowed. Rokicki focused on patterns using only 3/7/9 to reduce his search space.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 384px 8px; transform-origin: 384px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eUsage of matlab java math can be seen in the Test Suite. A function zcombvec is given in the function template to facilitate creation of all vectors that only use the 3/7/9 digits. Usage of zcombvec is not required.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 330px 8px; transform-origin: 330px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eM=OddlyTri_379(N,Q) where N=digit length, Q=number of solutions, M is a double vector of the Q values.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function M=OddlyTri_379(N,Q)\r\n M=zeros(Q,1);\r\n  \r\nend\r\n\r\nfunction cc = zcombvec(old, new)\r\n% old: base matrix\r\n% new: column vector of new elements to augment combinations\r\n% cc: matrix of all combinations of old with new\r\n%{ \r\n Usage \r\n a=[3];\r\n b=[3;7;9];\r\n for ih=2:2\r\n  a=zcombvec(a,b);\r\n end\r\n results in [3 3;3 7; 3 9]\r\n%}\r\n mm = size(old,1);\r\n nn = size(new,1);\r\n cc = repmat(old, nn, 1);\r\n t=repmat(new', mm, 1);\r\n cc = [cc  t(:)];\r\nend %zcombvec\r\n\r\nfunction Nsum=sum1NJava(N)\r\n% 1+2+...+N= N*(N+1)/2  Nsum=sum(1:N)\r\n% N may be either string or real\r\n% No commas allowed in N if it is a string\r\n% Nsum char\r\n import java.math.*\r\n \r\n BD1=BigDecimal(1); % Create a BigDecimal Constant\r\n BD2=BigDecimal(2);\r\n \r\n numval=BigDecimal(N); % N\r\n numval1=numval.add(BD1); % N+1\r\n numval1d2=numval1.divide(BD2);\r\n m1m2=numval.multiply(numval1d2);\r\n Nsum=char(m1m2);\r\nend %sum1NJava","test_suite":"%%\r\ntic\r\nN = 8;\r\nQ = 2;\r\nvalid = 0;\r\nM=OddlyTri_379(N,Q)\r\nM(M\u003c10^(N-1))=[]; %Verify digit lengths\r\nM(M\u003e=10^N)=[];\r\nM=unique(M);\r\nif length(M)==Q\r\n valid=prod(mod(prod(num2str(M)-'0',2),2));\r\n if valid % Now calc sums\r\n  Msum=M.*(M+1)/2;\r\n  for i=1:length(M)\r\n   valid=valid*prod(mod(prod(num2str(Msum(i))-'0',2),2));\r\n  end\r\n end\r\nend % length(M)==Q\r\nif valid\r\n fprintf('Valid set\\n')\r\n for i=1:length(M)\r\n  fprintf('%i\\n',M(i))\r\n end\r\nelse\r\n fprintf('Not Valid set: Q %i required\\n',Q)\r\n for i=1:length(M)\r\n  fprintf('%i %i\\n',M(i),M(i)*(M(i)+1)/2)\r\n end\r\nend\r\n\r\nassert(isequal(valid,1))\r\ntoc\r\n%%\r\nimport java.math.*\r\nBD1=BigDecimal(1); % Create a BigDecimal Constant\r\nBD2=BigDecimal(2);\r\ntic\r\nN = 9;\r\nQ = 1;\r\nvalid = 0;\r\nM=OddlyTri_379(N,Q)\r\nM(M\u003c10^(N-1))=[]; %Verify digit lengths\r\nM(M\u003e=10^N)=[];\r\nM=unique(M);\r\nif length(M)==Q\r\n valid=prod(mod(prod(num2str(M)-'0',2),2));\r\n if valid % Now calc sums using java math infinite precision\r\n  numval=BigDecimal(M); % M\r\n  numval1=numval.add(BD1); % M+1\r\n  numval1d2=numval1.divide(BD2); %(M+1)/2\r\n  m1m2=numval.multiply(numval1d2); %M*(M+1)/2\r\n  Msum=char(m1m2); %Convert Java variable to a string\r\n  if nnz(Msum=='0')\u003e0,valid=0;end % Check for any Even digits in sum\r\n  if nnz(Msum=='2')\u003e0,valid=0;end\r\n  if nnz(Msum=='4')\u003e0,valid=0;end\r\n  if nnz(Msum=='6')\u003e0,valid=0;end\r\n  if nnz(Msum=='8')\u003e0,valid=0;end\r\n end\r\nend % length(M)==Q\r\nif valid\r\n fprintf('Valid set\\n')\r\n for i=1:length(M)\r\n  %fprintf('%i\\n',M(i))\r\n  fprintf('%i %s\\n',M(i),Msum)\r\n end\r\nelse\r\n fprintf('Not Valid set: Q %i required\\n',Q)\r\n for i=1:length(M)\r\n  fprintf('%i %s\\n',M(i),Msum)\r\n end\r\nend\r\n\r\nassert(isequal(valid,1))\r\ntoc","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":3097,"edited_by":3097,"edited_at":"2022-09-14T03:27:55.000Z","deleted_by":null,"deleted_at":null,"solvers_count":5,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2022-09-13T17:29:39.000Z","updated_at":"2022-09-14T03:27:56.000Z","published_at":"2022-09-14T03:27:56.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eAZPC\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e created the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eOddly Triangular\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e contest on 9/7/22. The challenge is to find the longest sequence of N odd digits such that sum(1:value)  is composed of only odd digits. The contest ended on 9/8/22 as Rokicki created a 3.6 million digit solution with the implication that an infinite length pattern had been determined. [N=2, 17, sum(1:17)=153]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis is step two of the steps and processing types to find Rokicki's result.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis challenge is to find a solution subset with lengths 8 and 9 that only use the digits 3/7/9 in M. The sum(1:M(i)) may only use odd digits. Normal double variables will not suffice for the N=9 solution as the eps is 8 for the sum. There are 8 length 8 solutions if all odd digits are allowed. Rokicki focused on patterns using only 3/7/9 to reduce his search space.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eUsage of matlab java math can be seen in the Test Suite. A function zcombvec is given in the function template to facilitate creation of all vectors that only use the 3/7/9 digits. Usage of zcombvec is not required.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eM=OddlyTri_379(N,Q) where N=digit length, Q=number of solutions, M is a double vector of the Q values.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":2325,"title":"GJam 2014 Rd 1c: Reordering Train Cars (Large)","description":"This Challenge is derived from \u003chttp://code.google.com/codejam/contest/3004486/dashboard#s=p1 GJam 2014 Rd 1c: Reordering Train Cars (Large)\u003e.\r\n\r\nDetermine number of sequences for set of strings under the constraint that all same characters must be contiguous. The large case could have 26! or more permutations.\r\n\r\n*Input:* s, string of N space separated string segments of letters [a..z]. 1\u003c=N\u003c=100. Total letters \u003c=100.\r\n\r\n*Output:* val, number of possible sequences, modulo 1,000,000,007\r\n\r\n*Example:*  Small Train Case examples \r\n\r\n  ab bbbc cd Val=1 as only abbbbccd can be created\r\n  aa aa bc c Val=4 aa gives 2 positions, aa'aa''bcc,aa''aa'bcc, bcccaa'aa'',bcccaa''aa'\r\n  abc bcd  Val=0 as c is internal and thus can not connect to c of abc\r\n\r\n*Theory:* \u003chttp://www.mathworks.com/matlabcentral/cody/problems/2324-gjam-2014-rd-1c-train-cars Train Small Spoilers\u003e\r\n\r\nLarge Case specific info. See \u003chttp://www.mathworks.com/matlabcentral/cody/problems/1833-usage-of-java-math-add-multiply-pow Usage of java math\u003e for unlimited precision. Note intValue gives more precision than floatValue. No java factorial exists so a function, non-recursive, is suggested. The small solution can be converted via java BigInteger factorial, mod, multiply, and intValue to solve the large case.\r\n\r\n\r\nAdditional GJam solutions can be found at \u003chttp://go-hero.net/jam Example GJam Matlab solutions\u003e. Select Find Solutions, change Language to Matlab. The Test Suite, at the bottom, contains a full GJam Small Matlab solution. No Valid Matlab solutions were submitted during the contest.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 408.3px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 204.15px; transform-origin: 407px 204.15px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 94.5333px 7.91667px; transform-origin: 94.5333px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThis Challenge is derived from\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.95px 7.91667px; transform-origin: 1.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"http://code.google.com/codejam/contest/3004486/dashboard#s=p1\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eGJam 2014 Rd 1c: Reordering Train Cars (Large)\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.95px 7.91667px; transform-origin: 1.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 373.783px 7.91667px; transform-origin: 373.783px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eDetermine number of sequences for set of strings under the constraint that all same characters must be contiguous. The large case could have 26! or more permutations.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 19.4333px 7.91667px; transform-origin: 19.4333px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eInput:\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 296.4px 7.91667px; transform-origin: 296.4px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e s, string of N space separated string segments of letters [a..z]. 1\u0026lt;=N\u0026lt;=100. Total letters \u0026lt;=100.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 25.2667px 7.91667px; transform-origin: 25.2667px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eOutput:\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 183.233px 7.91667px; transform-origin: 183.233px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e val, number of possible sequences, modulo 1,000,000,007\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 31.1167px 7.91667px; transform-origin: 31.1167px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eExample:\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 87.2667px 7.91667px; transform-origin: 87.2667px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e Small Train Case examples\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 61.3px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 404px 30.65px; transform-origin: 404px 30.65px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 184.8px 7.91667px; transform-origin: 184.8px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 11.55px 7.91667px; transform-origin: 11.55px 7.91667px; \"\u003eab \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 173.25px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 173.25px 7.91667px; \"\u003ebbbc cd Val=1 as only abbbbccd can be created\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 327.25px 7.91667px; transform-origin: 327.25px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 11.55px 7.91667px; transform-origin: 11.55px 7.91667px; \"\u003eaa \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 130.9px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 130.9px 7.91667px; \"\u003eaa bc c Val=4 aa gives 2 positions\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 184.8px 7.91667px; transform-origin: 184.8px 7.91667px; \"\u003e, aa'aa''bcc,aa''aa'bcc, bcccaa'aa'',bcccaa''aa'\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 261.8px 7.91667px; transform-origin: 261.8px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 15.4px 7.91667px; transform-origin: 15.4px 7.91667px; \"\u003eabc \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 11.55px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 11.55px 7.91667px; \"\u003ebcd\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 7.7px 7.91667px; transform-origin: 7.7px 7.91667px; \"\u003e  \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 227.15px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 227.15px 7.91667px; \"\u003eVal=0 as c is internal and thus can not connect to c of abc\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 25.6667px 7.91667px; transform-origin: 25.6667px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eTheory:\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.95px 7.91667px; transform-origin: 1.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"http://www.mathworks.com/matlabcentral/cody/problems/2324-gjam-2014-rd-1c-train-cars\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eTrain Small Spoilers\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 91.0333px 7.91667px; transform-origin: 91.0333px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eLarge Case specific info. See\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.95px 7.91667px; transform-origin: 1.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"http://www.mathworks.com/matlabcentral/cody/problems/1833-usage-of-java-math-add-multiply-pow\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eUsage of java math\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 199.05px 7.91667px; transform-origin: 199.05px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e for unlimited precision. Note intValue gives more precision than floatValue. No java factorial exists so a function, non-recursive, is suggested. The small solution can be converted via java BigInteger factorial, mod, multiply, and intValue to solve the large case.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 131.083px 7.91667px; transform-origin: 131.083px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eAdditional GJam solutions can be found at\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.95px 7.91667px; transform-origin: 1.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"http://go-hero.net/jam\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eExample GJam Matlab solutions\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 139.267px 7.91667px; transform-origin: 139.267px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. Select Find Solutions, change Language to Matlab. The Test Suite, at the bottom, contains a full GJam Small Matlab solution. No Valid Matlab solutions were submitted during the contest.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function val=train(s)\r\n% s is a string of strings separated by a space\r\n val=0;\r\n vstr=regexp(s,' ','split');\r\nend","test_suite":"%%\r\ns='wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww gggggggggggggg ddddddddddddddddddddddddddddddddddddddd ddddddddddddddddddddddddddddddd ddddddddddddddddddddddddddddd dddddddddddddddddddddddddddddddddddddddddddddddddddddddd ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd dddddddd dddddddddddddddddddddd dddddd dddddddddddddd dddddddddddddddddddddddddddddddddddddddddddd xxxxxxxttttttttteeeeeeppppppppppppllllllliiiiiiiifffffffffffffffmmmmmmmmmmmjjjjjjjhhhhhhhhhh uuuuuuuuubbbbbbcccccccvvvvvvvvvvkkkkkkqqqqqaaayyyyyyooooooooooonnnnnnnnnnnnrrrrrzz dddddddddddddddddddddddddddddddddddddddddddddddd ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd d ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd dddddddddddddddddddddddddddddddddddddddddddddddddddd ddddddddddddddd ddddddddddddddddddddddddddddddddddddddddd ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss ddddddddddddddddddddddddddddddd ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd';\r\nVexp=728878867;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='ggi aaaaaaayy iiiaaaaaaa lllllllgggggg iiiiiooooooooo';\r\nVexp=0;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='ssssssssssssssssssssbbbbbbbbbbbbbbbbbbbbbbbb ccccccccccc jjjjjjjjjjjjjjjjjjddddddddddddggggggggggggggggg qqqqqqqqqqqqffffffffffffffffffuuuuuuuuuuuuuuaaaaaaaaaaaaaaaaaa ccccccccccccccccccccccccccccccccccccccccc kkkkkkkkkkkkkkkmmmmmmmmmmmmmmmmjjjjjjjjjjjjjjjjj cccccccccccccccccccccccccccllllllllllllllllllllllllllkkkkkkkkkkkkkkkkkkkkkkkkkkkkk eeeeeeeeeeeeeeeeeeeeeeeeeecccccccccccccccccccc jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiieeeeeeeeeeeeeeeeeeeeeeeeee nnnnnnzzz bbbbbbbbbbbbbbbbrrrrrrrrrrrrrnnnnnnnnnnnn ggggggggggggggggggggggggggggggggggqqqqqqqqqqqqqqqqqqqqqqqqqqq hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh eeeeeeeeeeeeee zzzzzzzzzzzzzzz aaaaaaaaaaaaaaaaaaaaaaaaappppppppppppppppppppssssssssssssssssssssssss';\r\nVexp=2;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='kkkkkkkkkkkkkkkkkkkkk llllaaaaaa gggggggggggghhhhhhhhhhh lllllllllllllllllllllllllllllllllllllll bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb dddddddddddddddddddddddddddddddddddddddddyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy aaaaaaaaa vvvvvvvvvv yyyyyyyyy xxxxxxxx bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb gggggggggggggggggggggggggggg ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss iiiiiiiiiiimmmmmmmmmmmmmmmmmmmm vvvvvvvvvvvvvvvvvvvvvvvvv ssssssssssssssssssssssssssuuuuuuuuuuuuuuuuuuuuuuuuuuuuu vvvvvvvvvvvvvv uuuuuuuuuuuuuuuuuuuiiiiiiiiiiiiiiiiiiiiiiiiiiiiii tttttttttttttttttttteeeeeeeeeeeeeeeeeeeeeeeeee oooooooooooooooooooooooooooooooooooooooooooo nnnnnnnjjjjjjjjjjjjjjjddddddddddd oooooooooooooooooooooooooooooooooooooooooogggggggggggggggggggggggggggggggggggggggg nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk ooooooooooooooooooooooooooooooooo vvvvvvvvvvvvvvvvvvvvvvvv bwwwwwwwwoooooo sssssssssssssssssssssssssss nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv ffffffffffffffffffffffffffffffffffffff kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzbbbbbbbbbbbbbbbbbbbbbbbbbbb ooooooooooo kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx pppppppppppppppppppppppppppppppppppppppppppppppppppppppppp kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv qqqqlllll mmmmmmmmmmmtttttttt uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu ccccccccccccccccccckkkkkkk yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh aaaaaaaaaaannnnnnnnnnnnnnn ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk hhhhhhhhhhhhhhhhhhhhhhhhhhrrrrrrrrrrrrrrrrrrqqqqqqqqqqqqqqqqqq';\r\nVexp=265420800;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='rrrrrrrrjjjjjjjjnnnnnnnyyyyyyxxxxxlllltttttttt';\r\nVexp=1;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww wwwwwwwwww yy wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh yyyyyyyyyyyyyyyyyyyyyyyyyyyyyiiiiiiiiiiiiiiiiiiiiiiiiii ggggggggggggggggggggggggggggggggggggggggggghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa wwwwwwwwwwwwwwwwwwwwwwwww xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx vvvvvvvvvvvvvvvvvv aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaalllllllllllllllllllllllllllllllllllllllllllllllll aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv nnnnnnnnnnnttttttttttttttttkkkkkkkkkkkkkkkjjjjjjjjjjjjjooooooooooooooooooo bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb wwwwwwwwwwwwwwwwwwwwwwwwwww lllllllllllllllllllllllllllllllgggggggggggggggggggggggggggggg wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww uuuuuuuuuuuuuuuuuuuuuuuuuuuuu wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh yyyyyyyyyyyyyyyyy wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww mmmmmmmmmmmmeeeeeeeeeeeesssssssssdddddddddddzzzzzzzzzzzzzzzzrrrrrrrrrrrrrrrrrffffffqqqqqqqqqqqqqqq bbbbbbbbbbbbbbbbbbbbbbpppppppppppppppppppppppppppppppppyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyy';\r\nVexp=161166448;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt tttttttttttttttttttttttttttttt qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq vvvvvvvvvvvvvvvvvvv lllll vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv jjjjjjjjjjjjjhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh vv tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt tttttttttttttttttttttttttttttttttttttttttttttttttt tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt tttttttttttttttttttttttttttttttttttttttttt zzzzzrrrraaaaaasssssssseeeeeegggggggiiiooooooooooooobbbbbbbbkkkkkkkkkkyyyyyyyyyyywwwwwwww tttttttttttttttttttttttttttttttttttttttttttttttt vvvvvvvvvvvvvvvmmmmmmmmmmmmmmmmmmmmmmmmmmmmm tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt lllllllllllllllllllllllllllllllllllllllllllllllllllllll nnnnnnnnnnnnnnnnnnnndddddddddddddddddddddddddddxxxxxxxxxxxxxxxx tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt ttttttttttttttttttttttttttttttttttttttttttttt ffffffffffffffffffffffffffffffffffjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhllllllllllllllllllllllllllllllllllllllllll tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt pppppppppppppppppppppppuuuuuuuuuuuuuuuuuuuuuuuuuuucccccccccccccccccc mmmmmmmmmmmmmmmmmmmmmm mmmmfffffffff jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj tttttttttttttttttttt';\r\nVexp=459335393;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='ppppppp aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz ttttttttttttttttttttttttttttaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ddddddddddddddddpppppppppppppppp hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh xxxxxxxxxxxxxxxxxxxxxxxxxxxx hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh aaaaaaaaaaaavvvvvvvvvvvvvvvv yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyykkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv hhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh pppppppppppppppppppppppppppjjjjjjjjjjjjjjjjjjjjjjjjjjjjj hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhh pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhh aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh nnnnnnnooooooooouuuuuuuuuuurrrrrrrrrrrwwwwwwww hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh wwwwwwwwwwwwwwwwwwwwwwwwwww hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh sssssssssssssssssssssss hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh ttttttttttttttt zzzzzzzzzzzzzzzzzzzzz ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ccccccccccccccccceeeeeeeeeeeeeeeeeeemmmmmmmmmmmmmmmmm ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh fffffffffffqqqqqqqqqqqq yyy vvvvvvvvvvvvvvvvvvv xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz aaaaaaaaaaaaaaaaaaaaaaaaaaa jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj zzzzzzzzzzzzzzzzzz zzzzzzzzzzzzzbbbbbbbbbb dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd hhhhhhhhhhhhhhhhhhhhhhh ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd kkkkkkkkkkkkkkkkkkkkkkkkkkkkkzzzzzzzzzzzzzzzzzzzzzzzzzzzzz vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss hhhhhhhh iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii ss hhhhhhhhhhhhhhhhhhh bbbbbbbbbbbbbbbsssssssssssss hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh dddddddddddddddddddddddddddddddddddddddd hhhhhhhhhhhhh tttttttttttttttttttttttttttttttttttttttttttttttt bbbbbbbb hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh ttttttttttttttttttttttt xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxtttttttttttttttttttttttttttttttt hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhh zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz hhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh';\r\nVexp=893810165;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhsssssssssssssssssssssssssss gggggggggggggggggggggggggggggggggggggg wwwwwwwwwwwwwwwwwwwwwwwwwww nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn ggggggggggggggggggggggggggggggggggggg qqqqqqqqqqqqqqqqqqwwwwwwwwwwwwwwwwwwwww iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii lllllllllllllllllllllllll ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj lllllllllllllllllyyyyyyyyyyyyyyyy qqqqqqqqqq wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww pppp bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjjjjjjjjjjhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh mmm sssssssssssssssssssssssssllllllllllllllllllll mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm iiiiiiiiigggggg mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii gggggggggqqqqqqqqqqqqqqqqqq qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq fffffffvvvvccccccccccccoooooddddddddd uuuuuuuuuuuuuuuuaaaaaaaaaaaaaaaaaarrrrrrrrrrrrrrrrrrrzzzzzzzzzzzzzzztttttttttttteeeeeeeeeeeeeeeeee ppppppppppppppppppppp hhhhhh ssss ppppppppppppppppppppppppppppppppxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx wwwwwwwwwwwwwwwwwmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkpppppppppppppppppppppppppppppppppppppppppppppppppp xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx yyyyyyyyy xxxxxxxxxxxxxxxxxxxxjjjjjjjjjjjjjjjjjjj lllllllllllllllllllll mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg wwwwww hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk';\r\nVexp=588556762;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii oooooooooooooooooooooooooooooooaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbb uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu oooooooooooooooooooooooooooooooooooooooooooo llllllllllllllllllllllllllllllllllllll bbbbbbbbb uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx aaaaaaaaaaaaaaaaa xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc oooooooooooooooooo cccccccccccccccccccccccccccccccccccccccccc llllllllllllllllllllllllllljjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn iiiiiiiiiiiiiiiiiii oooooooooooooooooooooooooooooooooooooooo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj iiiiiiiiiiiiii jjjjjjjjjjjjjjjjjjjjjjjwwwwwwwwwwwwwwwwwwwwww ooooooooooooooooooooooooooooooooooooooooooooooo bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbboooooooooooooooooooooooooooooooooooooooooooooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa oooooooooooooooooooooooooooooooooooooooooooo iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii ccccccccccccccccccccccccccccccccccccccccc bbbbbbbbbbbbbbbbbbbbbbbbbbb aaaaaaaaaaaaaaaa uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ooooooooooooooooooooo uuuu cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx kkkkkkkkkkkkk uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkllllllllllllllllllllllllllllllllllllllllllllll aaaaaaiiiiiiiiiiiiii uuuuuuuuuuuuu kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn ccccccccccccccccccccccccccccccccccccccccccccccccckkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk ooooooo jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo iiiiiiii eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb jjjjj kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb jjjjjjjjjjjjjjjjjjjj nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn xxxxxx llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll iiiiiiiiiiiiiiiiiiiiiiiiii nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxeeeeeeeeeeeeeeeeeeee wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww llllllllllllllllllllllllllllllllllllllllllllllllllllllll eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa uuuuuuuuuuuuuuuuuuu oooooooooooooooooooooooooooooooo jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee oooooooo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ii iiiiiiiiiiiiiiuuuuuuuuuuuuuuuuuu oooooooooooooooooooooooooooooooo xxxxxxxxxxxxxxxxxxxxxx lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww wwwwwwwwwww aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa llllllllllllllllllllllll eeeeeeeeeeeeeeeeeee lllllllllllllllllllllllllllllllllllllllllllllllll ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc';\r\nVexp=125298902;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='hhhhhhhhhvvvvv kkhh ppmmmmmmmmm zzxxx sssccccccc fffffffqq yyyyyyyeeeeee xxxxxxxxi eeeeeeeeaaaaaaaa jjjppppppp ddddf cccccrrrrrrrr';\r\nVexp=720;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr tttttttttttttttttttttttttttttttttttttttttttttttttttttttttt ppppppppppppppppppppppppppppppppppppppppppppyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz nnnnnnnnnnnnnnnnnnnnnnn qqqqqqqqqqqq llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll yyyyyyyyyyyyyyyyyyyyy ttttttttttttttttttttttttttttttttttttttttttttt zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzppppppppppppppppppppppppppppppppppppppppppp ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy ffffffffffff iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii ddddddddddddddddddddddddssssssssssssssssssssssssssssssss qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu zzzzzzzzzzzzzzzzzzz rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr cccccccccccccccccccccccccccccccccccccccccccc rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr ggggggggggggggggggggggggggggggggggggggggggggggggggggggg ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg aaaaaaaaaaaaaaaaaaaaa pppppppppppppppppppppppppppp yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy ccccccccccccccccccccccccc cccccccccccc aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa iiiiiiiiiiiiiiiiiiivvvvvvvvvvvvvvvvvvvvdddddddddddddddddd cccccccccccccccccaaaaaaaaaaaaaaaaaaaaa wwwwwwwwwwwwwwwwwwwwwwwooooooooooooooooooooo yyyyy llllllllllllllbbbbbbbbbbbbbbbbbbbbbuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy fffffffffffffffffffffffffffffffffzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr tttttttttttttttttttttttttttttttttttttttttttffffffffffffffffffffffffffffffffffffffff sssssssssssssssssssssssssss xxxxxxxxxxxxxxxxxxxxxx yyyyyqqqqqqq ffffffffff ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrttttttttttttttttttttttttttttttttttttttttttt xxxxxxxxxxxxxxxxxxxxxxxxxxx gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq ooooooooooooooooooooooooooooooooooooo rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr xxxxxxxxxxxxxxxxxxxxxxxxxxxxxeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii qqqqqqqqqqqqqqqqqqqqqqqqnnnnnnnnnnnnnnnnnnnn jjjjjjj ssssssssssssssssssssssssssssssssssssssssssswwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy jjjjjjjjjjjjjjjjjjjjjjjjjjjjjcccccccccccccccccccccccccccccccccc tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ggggggggggggggggggggggggggllllllllllllllll aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaarrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc qqqqqqqqqqqqqqqqqqqqqqqqq rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww ssssssss cccccccccccccccccccccccccccccccccc jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj tttttttttttttt iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx jjjjjjjjjjjjjjjjjjjjjj';\r\nVexp=45590719;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh mmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmm mmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll xxxxxxvvvvvvvvvvvvvoooooojjjjjjjjaaaaaaaffffffffppppppppyyyyyykkkkkkkkkqqqqqqqqqqrrrrrr mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm wwwwwwwnnnneeeeeeesssssuuuuuuuuuudddddddddiiiiiiii mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmm mmmmmmmmmmmmmmm ggggggggggggggggggggggggggggggcccccccccccccccccccccccccccccc mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt';\r\nVexp=757993753;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg gggggggggggggggggggggggggggggggg iihhhhhhaaaaaaaaallmmmmmeeedddddbbbbbbppssssssoooovvvvvvffffftttttttttqqqqqkkkkkknnnnn uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu rrrrrrrrrrrrrrrrrrrrrrrrrr gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg ggggggggggggggggggggggggggggggggggggg gggggggggggggggggggggggggggggggggggggggggggggggggg ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg ggggggggggggggggg rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyxxxxxxxxxxxxxxxxxxxxxxxxxxxxwwwwwwwwwwwwwwwwwwwwwwwwww';\r\nVexp=16857327;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='ccccccccccccccccccccccccccccccccccccccc zzzzzzzzzzzzzzzzzzzzzzzzzzzzzrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr llllllllllllllllllllllllllllllllllllllllllllllllllllll lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll tttttttttttaaaaaaaaakkkkkk qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq ccccccccccc uuuuuuuuuujjjjjjjssssssssssssss llll llllllllllllllllllllllllll cccccccccc lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc yyyyyyyyypppppppffffffffffxxxxxxxxxxxxxxiiiiiiiiiiiiiii hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh lllllllllllllllllllllllllllllllllllllll lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll hhhhhhhhhhhhhhhhhhhhh ccccccccccc mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz cccccccccccccccccccccccccccccccccccccccc hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn kkkggggggggeeeeeeeeeeeeeeeeeoooddddddddddwwwwwmmmmmmmmm bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz cccccccccccccccccc llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc llllllllllllllllllllllllllllllllllllllllllllll cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb';\r\nVexp=539156306;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa sssssssssssssbbbbbbbbbbbbbbbb nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn sssssssssssssssssssssss bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb nnnnnnnnnnnnnnnnnnnnnnnnnnnnnn bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb eeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ssssssssssssssssssssssssssssssssssss nnnnnnnnnnnnn ssssssssssssssssssssssssssssssssssssssssssssss eeeeeeeeeeeeeeeeeeeeeeeeeeeeee bbbbbb sssssssssssssss nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn aaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa nnnnnnnnnnnnnnnn sssssss bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa sssssssssssssssssssssssssssssssssssss bbbbbbbbbbbbbbbbbbbbbbbb nnnnnnnnnnnnneeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn ssssssssssssssssssssssssssssssssssss nnnn bbbbbbbbbbbbbbbbbbbnnnnnnnnnnnnnnnnn ssssssssssssssssssssssssssssssssssssssssss nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnn ssssssssssssss bbbb ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss sssss sssss sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn sssssssssssssssssssssssssssssssss nnnnn aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaa';\r\nVexp=392523621;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='ccccccccccccccccccccccccccccccccc llllllllllllllllllllllllllllllllllllll cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc llllllll llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll wwwwwwwwzzzzzzzzzzzzzeeeeeeeeeeuuuuuuuuvvvvvvvvvvvvvvrrrrrrrrrrtttttttttttttt llllllllllllllllllllllllllllllllllllllllllllllllllllllllll ttttttthhhhhmmmmmmmmmqqqqqqqqqqqqqq ccccccccccccccccccccccccccccccccccccccccccccc cccccccccccccccccccc lllllllllllllllllllllllllllllllll lllllllllllllllllllllllllllllllllllllllllllllllllllllllll llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll bbbbbbbppyyyyyyiiisssssssnnnff ccccccccccccc llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll llllllllllllllllllllllllllll xxxxxjjjjjjddddaaaaaakkkkkkkkk cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc llllllllllllllllllllllllllllllllllllllllllllllllllllll llllllllllllll lllllllllllllllll lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc cccccccccccccccccccccccccccccccccccccccccccccccccccccccc cccccccccccccccccccccccccccccccccccccclllllllllllllllllllllllllllllllllllll ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc cccccccccccccccccccccccccccccccccccccccccccccc ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc ccccccccccccccccccccccccccccccccccccccccc lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll cccccc tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc cccccccccccccccccccccccccccccccccccccccccccc';\r\nVexp=981953933;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='wwwwwwwwwwhhhhhhhhhh zzzzzzzzzzzzzzzzzzzzvvvvvvvvvvvvvvvaaaaaaaaaaaaaaaaaaaaaaiiiiiiiiiiiiiiiiiii kkkkkkkkkkkkkkkkkkkkk uuuuuuuuuuuuu jjjjjjjjjjjjjjjjjjjjjjjjjjjjjbbbbbbbbbbbbbbbb kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu uuuuuuuuuuuuuuuuuuuuuuuuuuuujjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj kkkkkkkkkkkkkkkkkk uuuuuuuuuuuuuuuuuu mmmmmmmmmmmmmmmmmmmmmmmpppppppppppppppp kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee jjjjjjjjjjjjjj eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee bbbbbbbbbbbbbbbbbbbbbbbbbbbqqqqqqqqqqqqqqqqqqqq jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk uuuuuuuuuuuuuuuuuu qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq lllllnnnnnnnnnnnnnnnnn nnnnn wwwwwwwwwwwwwwwww nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhheeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq wwwwwwwwwwwwwwwwwwww kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk xxxxxxxxxrrrrrrrrrgggggggggggggffffffffftttttttccccccccccccccccoooooooddddyyyyy eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww jjj uu bbbbbbbbbbbbbbbbbbb qqqqqqqqqqqqqqqqqqqqqqq qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeelllllllllllllllllllllllllllllllllllllllllllll bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww';\r\nVexp=310957976;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='aabbbbbcccddeeeeeeeefffgggggghhhhiiiiiiiijjkkkkklllmmmmmmmnnnooooppppppqqrrsssttuuuuuuuvvvvwxxyyyyya';\r\nVexp=0;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='bbbbbbbbbbbbbbbbbbbbbbbbbbb lllllllllllllllllllllllllllllllllllllllllll hhhhhhhhhhhhhhhhhhh kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt aaaa hhhhhhhhhhhhhhhhhh iiiiiiiiiiiiiiiiiiiiiiiiiiyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh bbbbbbbbbbbbbbbbbbbbbbb llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll nnnnnnnnnnnnnnnnnnnnnnnnnnn hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu hhhh jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv hhhhhhhhhhhhhhh bbbbbbbbbbbbbbbbbbbb bbbbbbbbbbbbbbbbbbbbbbb bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb qqqqqqsssssspppppppppmmmmmmfffffffff vvvvvvvooooooooooowwwwwwwwwwwccccccccrrrrrrrrrrddddddddddddddddddd xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ttttttttttttttttttttttttttttttttttttttttttttttttttttt uuuuuuuuuuuuuuuuuuuuuuuuu hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh nnnnnnnn hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhh uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh llllaa gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh nnnnnneeeeeeeeettt bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb tttttttttttttttttt zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz hhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb uuuuuuuuuuuuuuuuuuuuuuu hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh bbbbbbbbbbbbbbbbbbbbb nnnnnnnnnnnnnnnnnnnnnnnnnnn tttttttttttttttttttttttttttttttttttt uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzlllllllllllllllllllllllllllllllllllllllllll hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh kkkkkkkkkkkkkkkkkkk bbbbbbbbbbbbbbbbbbbbbbb uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh uuuuuuuuuuuuuuu aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaannnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn gggggggggggggggggggggggggggggggggggzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb';\r\nVexp=236753019;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt';\r\nVexp=1;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq dddddddlllllllllllllll xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm ssssssssssssssssssssssssssssssssttttttttttttttttttttttttttttttttttttttttttt hhhhhhhhhhhhhhhhhhhhhkkkkkkkkkkkkkkkkkkkkk aaaaaaaaaaaaaaaaaaaaaaaaaaaccccccccccccccccccccc gggggggggggggggggggggggggggggggggggggddddddddddddddddddddddddddddddddddddddd ttttttttttttttttttttttttttttiiiiiiiiiiiiiiiii llllllllllllllllllhhhhhhhhhhhhhhhhhhhhhh rrrrrrrrrrrrrrrrrzzzzzzzzzzzzz kkkkkkkwwwwwwwwwwwwwwwwwwwnnnnnnnnnnnnnyyyyyyyyyyyyy iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ppppppppppppppppppppppppppppppppppppppppppxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx qqqqqqqqqqqqqqqqqqqqbbbbbbbbbbbbbbbbbbbbbbssssssssssssssssssssssssssssssssss sssssssssssssss oooo ppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp mmmmmmmmmmmm ffffffeegggggggg iiiiiiiiiiiivvvvvvvvvvvvv yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvfffffffffffffffffffffffffffffffffffffffffffffff xxxxxxxxxxxxxxxxxxxxxxxxx oooooorr ffffffffffffffffff pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp xxxxxxxxxx ooooooooooooooooooooooo mmmmmmmmmmmmmmmmmmmmmmoooooooooooooooooooooooooooooo';\r\nVexp=48;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeeeeeee dduuknnnbbyyysssssqqmmfrrrrrraaaacczzziiiiigggggxxxllllp eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj vvvvvvvvvvvvvvvvvvvvvvhhhhhhhhhhhhhhhhhhhhhhhttttttttttttttttttttttttttt eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww eeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee';\r\nVexp=901255609;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ccccccccccccccccccccccc yyynnttooppphhhiiiwwllllggg vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv cccccccccccccccccccccccccccccccccccccccccccccc kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss kkkkmmmmmmm uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu fffffffffffff ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa sssssssssssssssssssssssssssssssssssssssssssssssssssss kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk sssssssssssss ccccccccccccccccccccccccccccccccccccccccccccccccccccccc jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjccccccccccccccccccccccccccccccccccccccccccc xxxxxxxxxxxxxxxddddddddddddddrrrrrrrrrrrrrrrrrrrrrrrqqqqqqqqqeeeeeeeeeeeee kkkkkkkkkkkkkkkkkkkkkkkkkkkkk ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss ssssssssssssssssssssssssssssssssssssssssssssssssssssssss mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk zzzzzzzzzzzzzzzzzz kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmzzzzzzzzzzzzzzzzzzzzzzzzzz';\r\nVexp=654434779;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='rrrr rrrrrrrrrrrrrrrrrrrrrrr pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp tttttttttttttttttttttttttttttttt lllllllllllllllllllllllllllllllllllllllllllllllllllllllll ttttttttttttttttttttttttttttttttttttttttttttttttttttt vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv gggggggggggggghhhhhhhhhhhhhhhhhxxxxxxxxxxxxxxxkkkkkkkkkkkkkkkkkccccccccccccc jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj lllllllllllllllllllllllllllllll vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii tttttttttttttttttttttttttttttttttttttttttttttttttt rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr ttttttttttttt qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii tttttttttttttttttttttt ttttttttttttttttttttttttttttttttttttttttttttttttttttttt rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr rrrrr jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll ppppppppppppppppppppppppppppp jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj wwwwwwwwwwwwwwwwwwwwwwwwwwwwwww tttttttttttttttttttttttttttttttttttt ooooooooooooooooooooooooooooooooonnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii rrrrr pppppppppppppp iiiiiiiiiiiiiiiiiiiiiii lllllllllllllll tttttttttttttttttttttttttttttttttttttttttt tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr lllllllllllllllllllllllllllll vvw llllllllllllllllllllllllllllllllllll pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr llllllllllllllllllllllllllllllllllllllllllllllllliiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii dddddddddddddddbbbbbbbbbbbbbbbbeeeeeeeeeeeeeeeeeeeyyyyyyyyyyyysssssssssssssssssssss mmmmmmmmmmmmmmmmmmmmmmmaaaaaaaaaaaaaaaaaaa ppppp vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr jjjjjjjjjjjjjjjjjjjjjjjjjjjj rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt nnnnnnnnnnnnnnnnuuuuuuuuuuuuuuuzzzzzzzzzzzzzzzzzzzzzz gggggggggggg tttttttttttttttttttttttttttttttttttttttttttttt rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv wwwwwwwwwwpppppp iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww jjjjjjjjjjj wwwwwwwwwwwwww wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww lllllllllllllllllllllllllllllllllllllllllllllllllllllllllll cccccccccccccccccccfffffffffffffffff llllllllllllllllllllllllllllllllllllllll tttttttttttttt pppppppppppppppppppppppppppppppppppppppp wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt jjjjjjjjjjjj ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo tttttttttttttttttttttttttttt zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzgggggggggggggggggggggggggggggggggggggggg rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii ttttttttttttttttttttttttttttttttttttttttttttttt llllllllllllllllllllllllllllllllllllllllllllllllll vvvvvvvvvv';\r\nVexp=977338612;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ccccccccccccccccccccccccccccccccccccccccccccccc ffffffffffffffffffffffffffffffffffffffffffffffffffpppppppppppppppppppppppppppppppppppppppppppppp cccccccccccccccccccccccjjjjjjjjjjj ppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp ccc pppppppppppppppppppppppppppppppppppsssssssssssssssssssssssssssssssssssssss ppppppppppppppppppppppppppp eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ssssssssssss iiiiiccccccccc jjjjjjffffffffffff ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ppppppppppppppppppppppppppppppppppppppppppppp ssssssssssssssssssssssssssssseeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp eeeeeeeeeeeemmmmmmmmm iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii';\r\nVexp=864;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj aaaaa ooooooooooooooooooo mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm nnnn sssssssssssssssssssssssssssssssssssssssssssssuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn gggggggggggggggggggggggggggggggggggggggggggggggggggggg aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj aaaaaaaaaaaaa jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee mmmmmmmmmmmmmmmmmmmmmm eeeeeeewwww nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo aaaaaaaaaaaaaaa wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz nnnnnnnnnnnnnnnnn lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv ppppppppppppppppppppppppppppppppppppppppppppppgggggggggggggggggggggggggggggggggggggggggggggggggggggg ttttttttttttttttttttttttttttttttttttttttttttt xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd fffffffffffffffffffffffffffffffffffffff cceee ooooooooooooooooo jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm ffffffffffffffffffffffffffffffffffffffffffffttttttttttttttttttttttttttttttttttttttttttttt xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp lllllllllllllllllllllllllllllllllllllllllllll fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn ppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp ttttttttttttttttttttsssssssssssssssssssssssssssssssssssssssss wwwwwwwwwwwwwwhhhhhhhhhhhhhhhhllllllll aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii ggggggggggggggggggggggggggggggggggggggggggggggggg aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ooooooooooooooooooooovvvvvvvvvvvvvvvvvvv aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa iiiiiiiiiiiiiiiiiiiiiiippppppppp cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv yyyyyyyyyyyyyyyyyyyyyyyyffffffffffffffffffffffffffffffffffffffffffffff aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa fffffffff mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm ggggggcccccccc mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm aaaaaaaaaaaaaaaaaaaaaaaaaaa kkkkkkkkkkkkkkkkkkkkkkkrrrrrrrrrrrrrrrrrrrrrrrrrr uuuuuuuuuuuuuiiiiiiiiii nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy mmmmmmmmmmmmmmm aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx iiiiiiiii';\r\nVexp=702191236;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='oooooooooooooooooooooooooooooooooooaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee bbbbbbbbbbblllllllllllllllllzzzzzzzzzzzvvvvvvvvvvvvvvvvqqqqqqqqqqqkkkkkkkkkkkkkhhhhhhhhhhhhhhh eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee nnnnnnnnnnnnnnnnnnnnnnnnn eeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee iiiiiiiiiiiiiiiiiiiiiiiiii iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnn eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee fffffffffffffffffffffffffffuuuuuuuuuuuuuuuuuuuuuuuu nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn rrrrrrrrrrrrrtttttttttttttmmmmmmmmmmmmccccccccyyyyyyyywwwww nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii pppppppppppppppsssssssssssssssssssjjjjjjjjjjjjjjjjjddddddddddddddddxxxxxxxxxxxxxxxx nnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee';\r\nVexp=880614102;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww vvvvvvvvvvvvvvvvvvvvvvvvvv wwwwwwwwwwwwwwwwwwww rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww wwwwwwwwwwwwwgggggg nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww ggggggggggggggggggg vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn gggggggggggggg nnnnnnnnnnnnnnnnnnnnnnnnnn vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww zzzzzzzzzzzzzzzdddddddddddddddddddddyyyyyyyyyyyyyy jjjttttxxxxhhfffllllllqqqqqiiiiiimmmmmmmmuueeeeccccsssooookkkkppppppaabbbbbb vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv nnnnnnnnnnnnnnnnnnnnnnnnnn vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg vvvvvvvvvvvvvvvvvvvvvvvnnnnnnnnnnnnnnnnnn wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww';\r\nVexp=101045724;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\n%s='jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk eeeeeeeeeeeeeeeeeeexxxxxxxxxxxxxxxxxxxxxxxx bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb yyyyyyyyyyyyyyyykkkkkkkkkk mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww oooo ggggggggggggggggyyyyyyyyyyyyyyy iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiihhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb iiiiiiii ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc hhhhhhhhhhhhhhggggggg hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh wwwwwaaaaaaa rrrrrrrrrrrrrrrr hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh ooojjjjjjj rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccccc kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk ddddddddddddddddddddddddddddddddddddddddd iiiiiiiiiiiiiiiiiiiiiiiiiiiii","published":true,"deleted":false,"likes_count":1,"comments_count":2,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":2,"test_suite_updated_at":"2020-10-01T17:08:50.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2014-05-15T21:15:21.000Z","updated_at":"2020-10-01T17:08:50.000Z","published_at":"2014-05-15T21:59:11.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis Challenge is derived from\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://code.google.com/codejam/contest/3004486/dashboard#s=p1\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eGJam 2014 Rd 1c: Reordering Train Cars (Large)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eDetermine number of sequences for set of strings under the constraint that all same characters must be contiguous. The large case could have 26! or more permutations.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eInput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e s, string of N space separated string segments of letters [a..z]. 1\u0026lt;=N\u0026lt;=100. Total letters \u0026lt;=100.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e val, number of possible sequences, modulo 1,000,000,007\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eExample:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Small Train Case examples\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ab bbbc cd Val=1 as only abbbbccd can be created\\naa aa bc c Val=4 aa gives 2 positions, aa'aa''bcc,aa''aa'bcc, bcccaa'aa'',bcccaa''aa'\\nabc bcd  Val=0 as c is internal and thus can not connect to c of abc]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eTheory:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/2324-gjam-2014-rd-1c-train-cars\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eTrain Small Spoilers\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eLarge Case specific info. See\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/1833-usage-of-java-math-add-multiply-pow\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUsage of java math\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e for unlimited precision. Note intValue gives more precision than floatValue. No java factorial exists so a function, non-recursive, is suggested. The small solution can be converted via java BigInteger factorial, mod, multiply, and intValue to solve the large case.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAdditional GJam solutions can be found at\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://go-hero.net/jam\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eExample GJam Matlab solutions\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. Select Find Solutions, change Language to Matlab. The Test Suite, at the bottom, contains a full GJam Small Matlab solution. No Valid Matlab solutions were submitted during the contest.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":42779,"title":"GJam March 2016 IOW: Polynesiaglot Large","description":"This Challenge is derived from \u003chttp://code.google.com/codejam/contest/8274486/dashboard#s=p2 GJam March 2016 Annual I/O for Polynesiaglot\u003e. This is the Large input set. The max Qraw is 100^500, (V+C)^L.\r\n\r\nThe GJam story goes that words are such that consonants are always followed by a vowel. Determine the number of possible words of length L using C consonants and V vowels. The final Q is to be modulo of the prime 1E9+7.\r\n\r\n*Input:* [C V L] , C[1,50], V[1,50], 1\u003c=L\u003c=500\r\n\r\n*Output:* [Q] max Qraw is 100^500; Q=mod(Qraw,1E9+7)\r\n\r\n*Examples:* [C V L] [Q]\r\n\r\n  [1 1 4] [5] {aaaa,aaba,abaa,baaa,baba}  invalid are {bbaa, aaab} \r\n  [1 2 2] [6] {aa,ae,ba,be,ee,ea} invalid are {ab,eb,bb}\r\n \r\n\r\n*\u003chttp://code.google.com/codejam Google Code Jam 2016 Open Qualifier: April 8, 2016\u003e*\r\n\r\n*Theory:* This is a huge value problem, on the order of (C+V)^L, thus brute force will not work. This is also a probability tree type problem. Tree calculations can be reduced to a linear in L evaluation. Inspection shows Q(1)=V, Q(2)=V^2, L=3 Q(3)=V^3+V*C*V+C*V^2 = V*Q(L-1)+V*C*Q(L-2)+C*Q(L-1).  There are no Cs at the Q1 level since can not end in a C. Qnext=f(Q(-1),Q(-2)). Qfinal=Q+C*Q(L-1)\r\n\r\n  Q3    V          C\r\n  Q2  V   C       V\r\n  Q1 V   V       V\r\n\r\nOne method to succeed in this problem is to use the java capability of Matlab.\r\n\u003chttp://www.mathworks.com/matlabcentral/cody/problems/1833-usage-of-java-math-add-multiply-pow Cody Java Challenge\u003e. The primary reference sites are \u003chttp://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Number.html Java Math\u003e, \u003chttp://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigDecimal.html Java BigDecimal\u003e, and \u003chttp://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigInteger.html Java BigInteger\u003e. The Java solution by the winner Stacy is included at the bottom of the test suite.\r\n\r\n","description_html":"\u003cp\u003eThis Challenge is derived from \u003ca href = \"http://code.google.com/codejam/contest/8274486/dashboard#s=p2\"\u003eGJam March 2016 Annual I/O for Polynesiaglot\u003c/a\u003e. This is the Large input set. The max Qraw is 100^500, (V+C)^L.\u003c/p\u003e\u003cp\u003eThe GJam story goes that words are such that consonants are always followed by a vowel. Determine the number of possible words of length L using C consonants and V vowels. The final Q is to be modulo of the prime 1E9+7.\u003c/p\u003e\u003cp\u003e\u003cb\u003eInput:\u003c/b\u003e [C V L] , C[1,50], V[1,50], 1\u0026lt;=L\u0026lt;=500\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput:\u003c/b\u003e [Q] max Qraw is 100^500; Q=mod(Qraw,1E9+7)\u003c/p\u003e\u003cp\u003e\u003cb\u003eExamples:\u003c/b\u003e [C V L] [Q]\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e[1 1 4] [5] {aaaa,aaba,abaa,baaa,baba}  invalid are {bbaa, aaab} \r\n[1 2 2] [6] {aa,ae,ba,be,ee,ea} invalid are {ab,eb,bb}\r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003e\u003ca href = \"http://code.google.com/codejam\"\u003eGoogle Code Jam 2016 Open Qualifier: April 8, 2016\u003c/a\u003e\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003eTheory:\u003c/b\u003e This is a huge value problem, on the order of (C+V)^L, thus brute force will not work. This is also a probability tree type problem. Tree calculations can be reduced to a linear in L evaluation. Inspection shows Q(1)=V, Q(2)=V^2, L=3 Q(3)=V^3+V*C*V+C*V^2 = V*Q(L-1)+V*C*Q(L-2)+C*Q(L-1).  There are no Cs at the Q1 level since can not end in a C. Qnext=f(Q(-1),Q(-2)). Qfinal=Q+C*Q(L-1)\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eQ3    V          C\r\nQ2  V   C       V\r\nQ1 V   V       V\r\n\u003c/pre\u003e\u003cp\u003eOne method to succeed in this problem is to use the java capability of Matlab. \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/1833-usage-of-java-math-add-multiply-pow\"\u003eCody Java Challenge\u003c/a\u003e. The primary reference sites are \u003ca href = \"http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Number.html\"\u003eJava Math\u003c/a\u003e, \u003ca href = \"http://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigDecimal.html\"\u003eJava BigDecimal\u003c/a\u003e, and \u003ca href = \"http://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigInteger.html\"\u003eJava BigInteger\u003c/a\u003e. The Java solution by the winner Stacy is included at the bottom of the test suite.\u003c/p\u003e","function_template":"function [T]=Polyglot(m)\r\n% T total words of length L using C consonants and V vowels\r\n% \r\n% import java.math.*\r\n% xBI=BigInteger(12)\r\n% zBI=xBI.add(yBI);\r\n% zBI=xBI.multiply(yBI);\r\n% mBI=xBI.mod(BigInteger('1000000007'));\r\n% z=str2num(zBI); % Convert JavaBigInteger to numeric\r\n \r\n\r\n import java.math.*\r\n\r\n C=BigInteger(m(1));  % BigInteger\r\n V=BigInteger(m(2));  % BigInteger\r\n L=m(3); % \r\n\r\n\r\n% Values above 255 get mod applied so use string input to BigInteger \r\n TJ=TJ.mod(BigInteger('1000000007'));\r\n% Convert BigInteger type to a numeric \r\n T=str2num(TJ);\r\n \r\n \r\nend","test_suite":"%%\r\ntic\r\n% T 0.7\r\nm=[1 1 4 ];\r\nv=Polyglot(m);\r\nvexp=[5 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 0.8\r\nm=[1 2 2 ];\r\nv=Polyglot(m);\r\nvexp=[6 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[43 47 500 ];\r\nv=Polyglot(m);\r\nvexp=[671294715 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[45 44 500 ];\r\nv=Polyglot(m);\r\nvexp=[474858966 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 104.4\r\nm=[1 1 500 ];\r\nv=Polyglot(m);\r\nvexp=[523068127 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 0.3\r\nm=[2 2 1 ];\r\nv=Polyglot(m);\r\nvexp=[2 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[48 41 500 ];\r\nv=Polyglot(m);\r\nvexp=[356064865 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 1.6\r\nm=[50 41 1 ];\r\nv=Polyglot(m);\r\nvexp=[41 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[41 40 500 ];\r\nv=Polyglot(m);\r\nvexp=[396751820 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[40 45 500 ];\r\nv=Polyglot(m);\r\nvexp=[938256882 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[46 44 500 ];\r\nv=Polyglot(m);\r\nvexp=[883121986 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[50 40 500 ];\r\nv=Polyglot(m);\r\nvexp=[684068183 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 1.3\r\nm=[4 3 2 ];\r\nv=Polyglot(m);\r\nvexp=[21 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[48 46 500 ];\r\nv=Polyglot(m);\r\nvexp=[15068072 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[46 47 500 ];\r\nv=Polyglot(m);\r\nvexp=[483582780 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[48 43 500 ];\r\nv=Polyglot(m);\r\nvexp=[357963597 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[40 50 500 ];\r\nv=Polyglot(m);\r\nvexp=[722287557 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[47 40 497 ];\r\nv=Polyglot(m);\r\nvexp=[142264969 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[42 45 500 ];\r\nv=Polyglot(m);\r\nvexp=[300845428 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[42 50 500 ];\r\nv=Polyglot(m);\r\nvexp=[626241204 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[50 50 499 ];\r\nv=Polyglot(m);\r\nvexp=[244005114 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 3.1\r\nm=[40 4 3 ];\r\nv=Polyglot(m);\r\nvexp=[1344 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 1.6\r\nm=[43 42 1 ];\r\nv=Polyglot(m);\r\nvexp=[42 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[44 49 500 ];\r\nv=Polyglot(m);\r\nvexp=[518096485 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[45 46 500 ];\r\nv=Polyglot(m);\r\nvexp=[223782662 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[49 40 500 ];\r\nv=Polyglot(m);\r\nvexp=[678295851 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 2.2\r\nm=[50 3 2 ];\r\nv=Polyglot(m);\r\nvexp=[159 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 2.3\r\nm=[48 4 2 ];\r\nv=Polyglot(m);\r\nvexp=[208 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[5 41 498 ];\r\nv=Polyglot(m);\r\nvexp=[583339519 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 3.3\r\nm=[3 43 2 ];\r\nv=Polyglot(m);\r\nvexp=[1978 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[41 49 500 ];\r\nv=Polyglot(m);\r\nvexp=[707985113 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[46 43 500 ];\r\nv=Polyglot(m);\r\nvexp=[254325944 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 0.0\r\nm=[2 1 1 ];\r\nv=Polyglot(m);\r\nvexp=[1 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[5 5 499 ];\r\nv=Polyglot(m);\r\nvexp=[167403707 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[48 40 500 ];\r\nv=Polyglot(m);\r\nvexp=[687213242 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 1.7\r\nm=[43 46 1 ];\r\nv=Polyglot(m);\r\nvexp=[46 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[43 4 498 ];\r\nv=Polyglot(m);\r\nvexp=[127737869 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[44 47 498 ];\r\nv=Polyglot(m);\r\nvexp=[809685798 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[41 50 500 ];\r\nv=Polyglot(m);\r\nvexp=[701760607 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[40 48 500 ];\r\nv=Polyglot(m);\r\nvexp=[783408764 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[3 40 499 ];\r\nv=Polyglot(m);\r\nvexp=[158384704 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[50 48 500 ];\r\nv=Polyglot(m);\r\nvexp=[198880135 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[49 44 497 ];\r\nv=Polyglot(m);\r\nvexp=[539871481 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[44 42 500 ];\r\nv=Polyglot(m);\r\nvexp=[227201453 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[41 47 500 ];\r\nv=Polyglot(m);\r\nvexp=[212311056 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 254.9\r\nm=[2 2 500 ];\r\nv=Polyglot(m);\r\nvexp=[667073398 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[45 50 500 ];\r\nv=Polyglot(m);\r\nvexp=[556413734 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 5.3\r\nm=[46 40 3 ];\r\nv=Polyglot(m);\r\nvexp=[211200 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[45 4 499 ];\r\nv=Polyglot(m);\r\nvexp=[334760532 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[40 43 500 ];\r\nv=Polyglot(m);\r\nvexp=[328797447 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[50 45 500 ];\r\nv=Polyglot(m);\r\nvexp=[225964115 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[49 42 500 ];\r\nv=Polyglot(m);\r\nvexp=[690707538 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[40 46 500 ];\r\nv=Polyglot(m);\r\nvexp=[195330871 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 1.6\r\nm=[5 4 2 ];\r\nv=Polyglot(m);\r\nvexp=[36 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[42 49 500 ];\r\nv=Polyglot(m);\r\nvexp=[188049811 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 0.0\r\nm=[1 1 1 ];\r\nv=Polyglot(m);\r\nvexp=[1 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 218.1\r\nm=[1 2 500 ];\r\nv=Polyglot(m);\r\nvexp=[696656237 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[42 40 500 ];\r\nv=Polyglot(m);\r\nvexp=[922192442 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[49 45 500 ];\r\nv=Polyglot(m);\r\nvexp=[763469125 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[50 42 500 ];\r\nv=Polyglot(m);\r\nvexp=[328920270 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 150.3\r\nm=[2 1 500 ];\r\nv=Polyglot(m);\r\nvexp=[260322005 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 3.4\r\nm=[5 49 2 ];\r\nv=Polyglot(m);\r\nvexp=[2646 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[47 47 500 ];\r\nv=Polyglot(m);\r\nvexp=[237431455 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[40 40 500 ];\r\nv=Polyglot(m);\r\nvexp=[29203332 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[43 41 500 ];\r\nv=Polyglot(m);\r\nvexp=[376005947 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[50 47 500 ];\r\nv=Polyglot(m);\r\nvexp=[378681068 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[47 50 500 ];\r\nv=Polyglot(m);\r\nvexp=[795014271 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 1.6\r\nm=[42 44 1 ];\r\nv=Polyglot(m);\r\nvexp=[44 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[40 41 500 ];\r\nv=Polyglot(m);\r\nvexp=[506257932 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[5 4 497 ];\r\nv=Polyglot(m);\r\nvexp=[272829097 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 1.7\r\nm=[50 50 1 ];\r\nv=Polyglot(m);\r\nvexp=[50 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 3.7\r\nm=[50 50 2 ];\r\nv=Polyglot(m);\r\nvexp=[5000 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[43 44 500 ];\r\nv=Polyglot(m);\r\nvexp=[607981550 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[50 49 500 ];\r\nv=Polyglot(m);\r\nvexp=[267081842 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[48 44 500 ];\r\nv=Polyglot(m);\r\nvexp=[612852205 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[45 48 500 ];\r\nv=Polyglot(m);\r\nvexp=[652373815 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[5 5 497 ];\r\nv=Polyglot(m);\r\nvexp=[336290141 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[41 42 500 ];\r\nv=Polyglot(m);\r\nvexp=[50517743 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[46 46 500 ];\r\nv=Polyglot(m);\r\nvexp=[251353420 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[45 49 500 ];\r\nv=Polyglot(m);\r\nvexp=[66724508 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[50 44 500 ];\r\nv=Polyglot(m);\r\nvexp=[390526622 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[45 47 500 ];\r\nv=Polyglot(m);\r\nvexp=[37814577 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[47 49 500 ];\r\nv=Polyglot(m);\r\nvexp=[923599754 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[44 48 500 ];\r\nv=Polyglot(m);\r\nvexp=[872350727 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[43 50 500 ];\r\nv=Polyglot(m);\r\nvexp=[668567771 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[41 4 498 ];\r\nv=Polyglot(m);\r\nvexp=[111334900 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 3.6\r\nm=[43 45 2 ];\r\nv=Polyglot(m);\r\nvexp=[3960 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 1.7\r\nm=[4 5 2 ];\r\nv=Polyglot(m);\r\nvexp=[45 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[40 49 500 ];\r\nv=Polyglot(m);\r\nvexp=[281852157 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[43 48 500 ];\r\nv=Polyglot(m);\r\nvexp=[884129281 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[41 48 500 ];\r\nv=Polyglot(m);\r\nvexp=[216141546 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[40 42 500 ];\r\nv=Polyglot(m);\r\nvexp=[488528258 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 3.3\r\nm=[5 42 2 ];\r\nv=Polyglot(m);\r\nvexp=[1974 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 1.7\r\nm=[45 45 1 ];\r\nv=Polyglot(m);\r\nvexp=[45 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[46 48 500 ];\r\nv=Polyglot(m);\r\nvexp=[190132182 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 0.3\r\nm=[1 2 1 ];\r\nv=Polyglot(m);\r\nvexp=[2 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 3.6\r\nm=[47 42 2 ];\r\nv=Polyglot(m);\r\nvexp=[3738 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[4 45 499 ];\r\nv=Polyglot(m);\r\nvexp=[999945335 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[44 40 500 ];\r\nv=Polyglot(m);\r\nvexp=[53296911 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[50 50 500 ];\r\nv=Polyglot(m);\r\nvexp=[3178118 ];\r\nassert(isequal(vexp,v))\r\n\r\n\r\n\r\ntoc\r\n\r\n%%\r\n% Stacy992 March 12, 2016\r\n% import java.util.*;\r\n% public class c {\r\n% \tpublic static long[][] memo;\r\n% \tpublic static long mod = 1000000007;\r\n% \tpublic static int c, v, l;\r\n% \tpublic static void main(String[] args){\r\n% \t\tScanner in = new Scanner(System.in);\r\n% \t\tint t = in.nextInt();\r\n% \t\tfor(int z = 1;z\u003c=t;z++){\r\n% \t\t\tc = in.nextInt();\r\n% \t\t\tv = in.nextInt();\r\n% \t\t\tl = in.nextInt();\r\n% \t\t\tmemo = new long[2][l];\r\n% \t\t\tfor(int i = 0;i\u003c2;i++){\r\n% \t\t\t\tArrays.fill(memo[i], -1);\r\n% \t\t\t}\r\n% \t\t\t\r\n% \t\t\tSystem.out.println(\"Case #\"+z+\": \"+go(0, 0));\r\n% \t\t}\r\n% \t}\r\n% \tpublic static long go(int flag, int pos){\r\n% \t\tif(pos == l){\r\n% \t\t\tif(flag == 1){\r\n% \t\t\t\treturn 0;\r\n% \t\t\t}\r\n% \t\t\treturn 1;\r\n% \t\t}\r\n% \t\t\r\n% \t\tif(memo[flag][pos] != -1){\r\n% \t\t\treturn memo[flag][pos];\r\n% \t\t}\r\n% \t\t\r\n% \t\tlong ans = 0;\r\n% \t\tans = (ans+(go(0, pos+1)*v))%mod;\r\n% \t\tif(flag != 1){\r\n% \t\t\tans = (ans+(go(1, pos+1)*c))%mod;\r\n% \t\t}\r\n% \t\treturn memo[flag][pos] = ans;\r\n% \t}\r\n% }\r\n\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":7,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-03-19T20:50:33.000Z","updated_at":"2016-03-19T23:05:52.000Z","published_at":"2016-03-19T23:05:52.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis Challenge is derived from\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://code.google.com/codejam/contest/8274486/dashboard#s=p2\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eGJam March 2016 Annual I/O for Polynesiaglot\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. This is the Large input set. The max Qraw is 100^500, (V+C)^L.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe GJam story goes that words are such that consonants are always followed by a vowel. Determine the number of possible words of length L using C consonants and V vowels. The final Q is to be modulo of the prime 1E9+7.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eInput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e [C V L] , C[1,50], V[1,50], 1\u0026lt;=L\u0026lt;=500\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e [Q] max Qraw is 100^500; Q=mod(Qraw,1E9+7)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eExamples:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e [C V L] [Q]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[[1 1 4] [5] {aaaa,aaba,abaa,baaa,baba}  invalid are {bbaa, aaab} \\n[1 2 2] [6] {aa,ae,ba,be,ee,ea} invalid are {ab,eb,bb}]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://code.google.com/codejam\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eGoogle Code Jam 2016 Open Qualifier: April 8, 2016\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eTheory:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e This is a huge value problem, on the order of (C+V)^L, thus brute force will not work. This is also a probability tree type problem. Tree calculations can be reduced to a linear in L evaluation. Inspection shows Q(1)=V, Q(2)=V^2, L=3 Q(3)=V^3+V*C*V+C*V^2 = V*Q(L-1)+V*C*Q(L-2)+C*Q(L-1). There are no Cs at the Q1 level since can not end in a C. Qnext=f(Q(-1),Q(-2)). Qfinal=Q+C*Q(L-1)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[Q3    V          C\\nQ2  V   C       V\\nQ1 V   V       V]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eOne method to succeed in this problem is to use the java capability of Matlab.\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/1833-usage-of-java-math-add-multiply-pow\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCody Java Challenge\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. The primary reference sites are\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Number.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eJava Math\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigDecimal.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eJava BigDecimal\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigInteger.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eJava BigInteger\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. The Java solution by the winner Stacy is included at the bottom of the test suite.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"}],"problem_search":{"errors":[],"problems":[{"id":1854,"title":"Factorial: Unlimited Size : java.math","description":"This challenge is an application of java.math that allows unlimited precision calculations.  The primary reference sites are \u003chttp://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Number.html Java Math\u003e, \u003chttp://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigDecimal.html Java BigDecimal\u003e, and \u003chttp://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigInteger.html Java BigInteger\u003e.\r\n\r\nThe usage of BigDecimal function multiply will be essential.\r\n\r\nJava Math tutorial: (Simplified summary that is believed correct)\r\n\r\n  vd-decimal value, vstr-string, vi-integer value \r\n  xBD=java.math.BigDecimal(vd);  % valid vd,vstr,vi creates xBD a BigDecimal variable\r\n  import java.math.*;  % simplifies statements\r\n  xBD=BigDecimal(vstr);\r\n \r\n  xmultiplyzBD=xBD.multiply(BigDecimal(z));  % multiply input requires BD type\r\n  \r\n  To convert java to string of unlimited length can be achieved via java toString or Matlab char\r\n  \r\n  xstr=toString(xBD)  or xstr=char(xBD) \r\n\r\n*Input:* N  [1\u003c N \u003c 1000]\r\n\r\n*Output:* Y  (char variable of Y=N! or a BigDecimal variable)\r\n\r\n\u003chttp://www.nitrxgen.net/factorialcalc.php Factorial Calculator\u003e\r\n\r\n*Related Challenges:*\r\n\r\n\u003chttp://www.mathworks.com/matlabcentral/cody/problems/1833-usage-of-java-math-add-multiply-pow 1. Usage of java math\u003e\r\n\r\n  2. nchoosek_large (full precision)\r\n  2. Next Prime\r\n  3. factor_large\r\n  4. Factorial","description_html":"\u003cp\u003eThis challenge is an application of java.math that allows unlimited precision calculations.  The primary reference sites are \u003ca href = \"http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Number.html\"\u003eJava Math\u003c/a\u003e, \u003ca href = \"http://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigDecimal.html\"\u003eJava BigDecimal\u003c/a\u003e, and \u003ca href = \"http://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigInteger.html\"\u003eJava BigInteger\u003c/a\u003e.\u003c/p\u003e\u003cp\u003eThe usage of BigDecimal function multiply will be essential.\u003c/p\u003e\u003cp\u003eJava Math tutorial: (Simplified summary that is believed correct)\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003evd-decimal value, vstr-string, vi-integer value \r\nxBD=java.math.BigDecimal(vd);  % valid vd,vstr,vi creates xBD a BigDecimal variable\r\nimport java.math.*;  % simplifies statements\r\nxBD=BigDecimal(vstr);\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003exmultiplyzBD=xBD.multiply(BigDecimal(z));  % multiply input requires BD type\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eTo convert java to string of unlimited length can be achieved via java toString or Matlab char\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003exstr=toString(xBD)  or xstr=char(xBD) \r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003eInput:\u003c/b\u003e N  [1\u0026lt; N \u0026lt; 1000]\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput:\u003c/b\u003e Y  (char variable of Y=N! or a BigDecimal variable)\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://www.nitrxgen.net/factorialcalc.php\"\u003eFactorial Calculator\u003c/a\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003eRelated Challenges:\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/1833-usage-of-java-math-add-multiply-pow\"\u003e1. Usage of java math\u003c/a\u003e\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e2. nchoosek_large (full precision)\r\n2. Next Prime\r\n3. factor_large\r\n4. Factorial\r\n\u003c/pre\u003e","function_template":"function y = factorialJava(N)\r\n import java.math.*\r\n y = num2str(factorial(N));\r\nend","test_suite":"%%\r\ntic\r\nN=69;\r\ny = factorialJava(N);\r\nassert(strcmp(y,'171122452428141311372468338881272839092270544893520369393648040923257279754140647424000000000000000'))\r\ntoc\r\n%%\r\ntic\r\nN=randi(18)\r\ny = factorialJava(N);\r\nassert(strcmp(y,num2str(factorial(N))))\r\ntoc\r\n%%\r\ntic\r\nN=randi(18)\r\ny = factorialJava(N);\r\nassert(strcmp(y,num2str(factorial(N))))\r\ntoc\r\n%%\r\ntic\r\nN=1000;\r\ny = factorialJava(N);\r\nassert(strcmp(y,'402387260077093773543702433923003985719374864210714632543799910429938512398629020592044208486969404800479988610197196058631666872994808558901323829669944590997424504087073759918823627727188732519779505950995276120874975462497043601418278094646496291056393887437886487337119181045825783647849977012476632889835955735432513185323958463075557409114262417474349347553428646576611667797396668820291207379143853719588249808126867838374559731746136085379534524221586593201928090878297308431392844403281231558611036976801357304216168747609675871348312025478589320767169132448426236131412508780208000261683151027341827977704784635868170164365024153691398281264810213092761244896359928705114964975419909342221566832572080821333186116811553615836546984046708975602900950537616475847728421889679646244945160765353408198901385442487984959953319101723355556602139450399736280750137837615307127761926849034352625200015888535147331611702103968175921510907788019393178114194545257223865541461062892187960223838971476088506276862967146674697562911234082439208160153780889893964518263243671616762179168909779911903754031274622289988005195444414282012187361745992642956581746628302955570299024324153181617210465832036786906117260158783520751516284225540265170483304226143974286933061690897968482590125458327168226458066526769958652682272807075781391858178889652208164348344825993266043367660176999612831860788386150279465955131156552036093988180612138558600301435694527224206344631797460594682573103790084024432438465657245014402821885252470935190620929023136493273497565513958720559654228749774011413346962715422845862377387538230483865688976461927383814900140767310446640259899490222221765904339901886018566526485061799702356193897017860040811889729918311021171229845901641921068884387121855646124960798722908519296819372388642614839657382291123125024186649353143970137428531926649875337218940694281434118520158014123344828015051399694290153483077644569099073152433278288269864602789864321139083506217095002597389863554277196742822248757586765752344220207573630569498825087968928162753848863396909959826280956121450994871701244516461260379029309120889086942028510640182154399457156805941872748998094254742173582401063677404595741785160829230135358081840096996372524230560855903700624271243416909004153690105933983835777939410970027753472000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'))\r\ntoc\r\n%%\r\ntic\r\nN=42;\r\ny = factorialJava(N);\r\nassert(strcmp(y,'1405006117752879898543142606244511569936384000000000'))\r\ntoc\r\n\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":47,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-08-30T01:59:14.000Z","updated_at":"2025-12-10T03:30:57.000Z","published_at":"2013-08-30T02:37:28.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis challenge is an application of java.math that allows unlimited precision calculations. The primary reference sites are\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Number.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eJava Math\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigDecimal.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eJava BigDecimal\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigInteger.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eJava BigInteger\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe usage of BigDecimal function multiply will be essential.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eJava Math tutorial: (Simplified summary that is believed correct)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[vd-decimal value, vstr-string, vi-integer value \\nxBD=java.math.BigDecimal(vd);  % valid vd,vstr,vi creates xBD a BigDecimal variable\\nimport java.math.*;  % simplifies statements\\nxBD=BigDecimal(vstr);\\n\\nxmultiplyzBD=xBD.multiply(BigDecimal(z));  % multiply input requires BD type\\n\\nTo convert java to string of unlimited length can be achieved via java toString or Matlab char\\n\\nxstr=toString(xBD)  or xstr=char(xBD)]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eInput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e N [1\u0026lt; N \u0026lt; 1000]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Y (char variable of Y=N! or a BigDecimal variable)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.nitrxgen.net/factorialcalc.php\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eFactorial Calculator\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eRelated Challenges:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/1833-usage-of-java-math-add-multiply-pow\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e1. Usage of java math\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[2. nchoosek_large (full precision)\\n2. Next Prime\\n3. factor_large\\n4. Factorial]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":55715,"title":"AZPC Oddly Triangular: N=35/305 using Digits 3/7/9  Part 5 of 5","description":"AZPC created the Oddly Triangular contest on 9/7/22. The challenge is to find the longest sequence of N odd digits such that sum(1:value)  is composed of only odd digits. The contest ended on 9/8/22 as Rokicki created a 3.6 million digit solution with the implication that an infinite length pattern had been determined. [N=2, 17, sum(1:17)=153]\r\nPart 5 is a generalization of multiple solutions to find Rokicki's result.\r\nReviewing the N=8/11/14 3/7/9 solutions determine a form such that N=5+3*n.\r\nThe values 397979797973 and 399799799799799733 has N=6+6*n given the generalization of  3[1]9[n]7[1]9[n]7[1]9[n]7[1]9[n]7[1]9[n]7[1]3[n]\r\nUsage of matlab java math can be seen in the Test Suite. A function zcombvec is given in the function template to facilitate creation of all vectors that only use the 3/7/9 digits. Usage of zcombvec is not required.\r\nM=OddlyTri5p3n_379(N) where N=digit length, M is a string of length N.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 255px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 127.5px; transform-origin: 407px 127.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eAZPC\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 40px 8px; transform-origin: 40px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e created the \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eOddly Triangular\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 270.5px 8px; transform-origin: 270.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e contest on 9/7/22. The challenge is to find the longest sequence of N odd digits such that sum(1:value)  is composed of only odd digits. The contest ended on 9/8/22 as Rokicki created a 3.6 million digit solution with the implication that an infinite length pattern had been determined. [N=2, 17, sum(1:17)=153]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 214.5px 8px; transform-origin: 214.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ePart 5 is a generalization of multiple solutions to find Rokicki's result.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 243.5px 8px; transform-origin: 243.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eReviewing the N=8/11/14 3/7/9 solutions determine a form such that N=5+3*n.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 304.5px 8px; transform-origin: 304.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe values 397979797973 and 399799799799799733 has N=6+6*n given the generalization of  3[1]9[n]7[1]9[n]7[1]9[n]7[1]9[n]7[1]9[n]7[1]3[n]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 384px 8px; transform-origin: 384px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eUsage of matlab java math can be seen in the Test Suite. A function zcombvec is given in the function template to facilitate creation of all vectors that only use the 3/7/9 digits. Usage of zcombvec is not required.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 223.5px 8px; transform-origin: 223.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eM=OddlyTri5p3n_379(N) where N=digit length, M is a string of length N.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function M=OddlyTri5p3n_379(N)\r\n% M needs to be a string of length N\r\n M='339';\r\n  \r\nend","test_suite":"%%\r\nimport java.math.*\r\nBD1=BigDecimal(1); % Create a BigDecimal Constant\r\nBD2=BigDecimal(2);\r\ntic\r\nN = 35;\r\n\r\nM=OddlyTri5p3n_379(N) % M is a string\r\nvalid=length(M)==N;\r\n if nnz(M=='0')\u003e0,valid=0;end % Check for any Even digits in M\r\n if nnz(M=='2')\u003e0,valid=0;end\r\n if nnz(M=='4')\u003e0,valid=0;end\r\n if nnz(M=='6')\u003e0,valid=0;end\r\n if nnz(M=='8')\u003e0,valid=0;end\r\n   \r\n if valid % Now calc sums using java math infinite precision\r\n   numval=BigDecimal(M); % M\r\n   numval1=numval.add(BD1); % M+1\r\n   numval1d2=numval1.divide(BD2); %(M+1)/2\r\n   m1m2=numval.multiply(numval1d2); %M*(M+1)/2\r\n   Msum=char(m1m2); %Convert Java variable to a string\r\n   if nnz(Msum=='0')\u003e0,valid=0;end % Check for any Even digits in sum\r\n   if nnz(Msum=='2')\u003e0,valid=0;end\r\n   if nnz(Msum=='4')\u003e0,valid=0;end\r\n   if nnz(Msum=='6')\u003e0,valid=0;end\r\n   if nnz(Msum=='8')\u003e0,valid=0;end\r\n end\r\n\r\n\r\nif valid\r\n fprintf('Valid set\\n')\r\n fprintf('%s %s\\n',M,Msum)\r\nelse\r\n fprintf('Not Valid: \\n')\r\n fprintf('%s %s\\n',M,Msum)\r\nend\r\n\r\nassert(isequal(valid,1))\r\ntoc\r\n%%\r\nimport java.math.*\r\nBD1=BigDecimal(1); % Create a BigDecimal Constant\r\nBD2=BigDecimal(2);\r\ntic\r\nN = 305;\r\n\r\nM=OddlyTri5p3n_379(N) % M is a string\r\nvalid=length(M)==N;\r\n if nnz(M=='0')\u003e0,valid=0;end % Check for any Even digits in M\r\n if nnz(M=='2')\u003e0,valid=0;end\r\n if nnz(M=='4')\u003e0,valid=0;end\r\n if nnz(M=='6')\u003e0,valid=0;end\r\n if nnz(M=='8')\u003e0,valid=0;end\r\n   \r\n if valid % Now calc sums using java math infinite precision\r\n   numval=BigDecimal(M); % M\r\n   numval1=numval.add(BD1); % M+1\r\n   numval1d2=numval1.divide(BD2); %(M+1)/2\r\n   m1m2=numval.multiply(numval1d2); %M*(M+1)/2\r\n   Msum=char(m1m2); %Convert Java variable to a string\r\n   if nnz(Msum=='0')\u003e0,valid=0;end % Check for any Even digits in sum\r\n   if nnz(Msum=='2')\u003e0,valid=0;end\r\n   if nnz(Msum=='4')\u003e0,valid=0;end\r\n   if nnz(Msum=='6')\u003e0,valid=0;end\r\n   if nnz(Msum=='8')\u003e0,valid=0;end\r\n end\r\n\r\n\r\nif valid\r\n fprintf('Valid set\\n')\r\n for i=1:50:length(M)\r\n  fprintf('%s\\n',M(i:min(length(M),i+49)))\r\n end\r\n fprintf('\\n')\r\n for i=1:50:length(Msum)\r\n  fprintf('%s\\n',Msum(i:min(length(Msum),i+49)))\r\n end\r\nelse\r\n fprintf('Not Valid: \\n')\r\n for i=1:50:length(M)\r\n  fprintf('%s\\n',M(i:min(length(M),i+49)))\r\n end\r\n fprintf('\\n')\r\n for i=1:50:length(Msum)\r\n  fprintf('%s\\n',Msum(i:min(length(Msum),i+49)))\r\n end\r\nend\r\n\r\nassert(isequal(valid,1))\r\ntoc\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":3097,"edited_by":3097,"edited_at":"2022-09-14T03:38:06.000Z","deleted_by":null,"deleted_at":null,"solvers_count":5,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2022-09-14T03:11:12.000Z","updated_at":"2022-09-14T03:38:07.000Z","published_at":"2022-09-14T03:38:07.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eAZPC\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e created the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eOddly Triangular\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e contest on 9/7/22. The challenge is to find the longest sequence of N odd digits such that sum(1:value)  is composed of only odd digits. The contest ended on 9/8/22 as Rokicki created a 3.6 million digit solution with the implication that an infinite length pattern had been determined. [N=2, 17, sum(1:17)=153]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePart 5 is a generalization of multiple solutions to find Rokicki's result.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eReviewing the N=8/11/14 3/7/9 solutions determine a form such that N=5+3*n.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe values 397979797973 and 399799799799799733 has N=6+6*n given the generalization of  3[1]9[n]7[1]9[n]7[1]9[n]7[1]9[n]7[1]9[n]7[1]3[n]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eUsage of matlab java math can be seen in the Test Suite. A function zcombvec is given in the function template to facilitate creation of all vectors that only use the 3/7/9 digits. Usage of zcombvec is not required.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eM=OddlyTri5p3n_379(N) where N=digit length, M is a string of length N.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":55710,"title":"AZPC Oddly Triangular: N=34/304 using Digits 3/7/9  Part 4 of 5","description":"AZPC created the Oddly Triangular contest on 9/7/22. The challenge is to find the longest sequence of N odd digits such that sum(1:value)  is composed of only odd digits. The contest ended on 9/8/22 as Rokicki created a 3.6 million digit solution with the implication that an infinite length pattern had been determined. [N=2, 17, sum(1:17)=153]\r\nPart 4 is the generalization of multiple solutions to find Rokicki's result.\r\nReviewing the N=7/10/13 3/7/9 solutions determine a form such that N=4+3*n.\r\nThe values 397979797973 and 399799799799799733 has N=6+6*n given the generalization of  3[1]9[n]7[1]9[n]7[1]9[n]7[1]9[n]7[1]9[n]7[1]3[n]\r\nUsage of matlab java math can be seen in the Test Suite. A function zcombvec is given in the function template to facilitate creation of all vectors that only use the 3/7/9 digits. Usage of zcombvec is not required.\r\nM=OddlyTri4p3n_379(N) where N=digit length, M is a string of length N.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 255px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 127.5px; transform-origin: 407px 127.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eAZPC\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 40px 8px; transform-origin: 40px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e created the \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eOddly Triangular\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 270.5px 8px; transform-origin: 270.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e contest on 9/7/22. The challenge is to find the longest sequence of N odd digits such that sum(1:value)  is composed of only odd digits. The contest ended on 9/8/22 as Rokicki created a 3.6 million digit solution with the implication that an infinite length pattern had been determined. [N=2, 17, sum(1:17)=153]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 220.5px 8px; transform-origin: 220.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ePart 4 is the generalization of multiple solutions to find Rokicki's result.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 244px 8px; transform-origin: 244px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eReviewing the N=7/10/13 3/7/9 solutions determine a form such that N=4+3*n.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 304.5px 8px; transform-origin: 304.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe values 397979797973 and 399799799799799733 has N=6+6*n given the generalization of  3[1]9[n]7[1]9[n]7[1]9[n]7[1]9[n]7[1]9[n]7[1]3[n]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 384px 8px; transform-origin: 384px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eUsage of matlab java math can be seen in the Test Suite. A function zcombvec is given in the function template to facilitate creation of all vectors that only use the 3/7/9 digits. Usage of zcombvec is not required.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 223.5px 8px; transform-origin: 223.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eM=OddlyTri4p3n_379(N) where N=digit length, M is a string of length N.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function M=OddlyTri4p3n_379(N)\r\n% M needs to be a string of length N\r\n M='339';\r\n  \r\nend","test_suite":"%%\r\nimport java.math.*\r\nBD1=BigDecimal(1); % Create a BigDecimal Constant\r\nBD2=BigDecimal(2);\r\ntic\r\nN = 34;\r\n\r\nM=OddlyTri4p3n_379(N) % M is a string\r\nvalid=length(M)==N;\r\n if nnz(M=='0')\u003e0,valid=0;end % Check for any Even digits in M\r\n if nnz(M=='2')\u003e0,valid=0;end\r\n if nnz(M=='4')\u003e0,valid=0;end\r\n if nnz(M=='6')\u003e0,valid=0;end\r\n if nnz(M=='8')\u003e0,valid=0;end\r\n   \r\n if valid % Now calc sums using java math infinite precision\r\n   numval=BigDecimal(M); % M\r\n   numval1=numval.add(BD1); % M+1\r\n   numval1d2=numval1.divide(BD2); %(M+1)/2\r\n   m1m2=numval.multiply(numval1d2); %M*(M+1)/2\r\n   Msum=char(m1m2); %Convert Java variable to a string\r\n   if nnz(Msum=='0')\u003e0,valid=0;end % Check for any Even digits in sum\r\n   if nnz(Msum=='2')\u003e0,valid=0;end\r\n   if nnz(Msum=='4')\u003e0,valid=0;end\r\n   if nnz(Msum=='6')\u003e0,valid=0;end\r\n   if nnz(Msum=='8')\u003e0,valid=0;end\r\n end\r\n\r\n\r\nif valid\r\n fprintf('Valid set\\n')\r\n fprintf('%s %s\\n',M,Msum)\r\nelse\r\n fprintf('Not Valid: \\n')\r\n fprintf('%s %s\\n',M,Msum)\r\nend\r\n\r\nassert(isequal(valid,1))\r\ntoc\r\n%%\r\nimport java.math.*\r\nBD1=BigDecimal(1); % Create a BigDecimal Constant\r\nBD2=BigDecimal(2);\r\ntic\r\nN = 304;\r\n\r\nM=OddlyTri4p3n_379(N) % M is a string\r\nvalid=length(M)==N;\r\n if nnz(M=='0')\u003e0,valid=0;end % Check for any Even digits in M\r\n if nnz(M=='2')\u003e0,valid=0;end\r\n if nnz(M=='4')\u003e0,valid=0;end\r\n if nnz(M=='6')\u003e0,valid=0;end\r\n if nnz(M=='8')\u003e0,valid=0;end\r\n   \r\n if valid % Now calc sums using java math infinite precision\r\n   numval=BigDecimal(M); % M\r\n   numval1=numval.add(BD1); % M+1\r\n   numval1d2=numval1.divide(BD2); %(M+1)/2\r\n   m1m2=numval.multiply(numval1d2); %M*(M+1)/2\r\n   Msum=char(m1m2); %Convert Java variable to a string\r\n   if nnz(Msum=='0')\u003e0,valid=0;end % Check for any Even digits in sum\r\n   if nnz(Msum=='2')\u003e0,valid=0;end\r\n   if nnz(Msum=='4')\u003e0,valid=0;end\r\n   if nnz(Msum=='6')\u003e0,valid=0;end\r\n   if nnz(Msum=='8')\u003e0,valid=0;end\r\n end\r\n\r\n\r\nif valid\r\n fprintf('Valid set\\n')\r\n for i=1:50:length(M)\r\n  fprintf('%s\\n',M(i:min(length(M),i+49)))\r\n end\r\n fprintf('\\n')\r\n for i=1:50:length(Msum)\r\n  fprintf('%s\\n',Msum(i:min(length(Msum),i+49)))\r\n end\r\nelse\r\n fprintf('Not Valid: \\n')\r\n for i=1:50:length(M)\r\n  fprintf('%s\\n',M(i:min(length(M),i+49)))\r\n end\r\n fprintf('\\n')\r\n for i=1:50:length(Msum)\r\n  fprintf('%s\\n',Msum(i:min(length(Msum),i+49)))\r\n end\r\nend\r\n\r\nassert(isequal(valid,1))\r\ntoc","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":3097,"edited_by":3097,"edited_at":"2022-09-14T03:36:05.000Z","deleted_by":null,"deleted_at":null,"solvers_count":5,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2022-09-14T02:51:43.000Z","updated_at":"2022-09-14T03:36:05.000Z","published_at":"2022-09-14T03:36:05.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eAZPC\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e created the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eOddly Triangular\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e contest on 9/7/22. The challenge is to find the longest sequence of N odd digits such that sum(1:value)  is composed of only odd digits. The contest ended on 9/8/22 as Rokicki created a 3.6 million digit solution with the implication that an infinite length pattern had been determined. [N=2, 17, sum(1:17)=153]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePart 4 is the generalization of multiple solutions to find Rokicki's result.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eReviewing the N=7/10/13 3/7/9 solutions determine a form such that N=4+3*n.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe values 397979797973 and 399799799799799733 has N=6+6*n given the generalization of  3[1]9[n]7[1]9[n]7[1]9[n]7[1]9[n]7[1]9[n]7[1]3[n]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eUsage of matlab java math can be seen in the Test Suite. A function zcombvec is given in the function template to facilitate creation of all vectors that only use the 3/7/9 digits. Usage of zcombvec is not required.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eM=OddlyTri4p3n_379(N) where N=digit length, M is a string of length N.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":1833,"title":"Usage of java.math : Add, Multiply, Pow","description":"This challenge is an introduction to the wonderful word of java.math that allows unlimited precision calculations.  The primary reference sites are \u003chttp://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Number.html Java Math\u003e, \u003chttp://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigDecimal.html Java BigDecimal\u003e, and \u003chttp://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigInteger.html Java BigInteger\u003e.\r\n\r\nThe usage of BigDecimal functions add, multiply, and pow will be tested.\r\n\r\nJava Math tutorial: (Simplified summary that is believed correct)\r\n\r\n  vd-decimal value, vstr-string, vi-integer value \r\n  xBD=java.math.BigDecimal(vd);  % valid vd,vstr,vi creates xBD a BigDecimal variable\r\n  import java.math.*;  % simplifies statements\r\n  xBD=BigDecimal(vstr);\r\n  x2pwrBD=xBD.pow(vi); % Invalid: vd,vstr,BD\r\n  xplusyBD=xBD.add(BigDecimal(y)); % add input requires BD type\r\n  xmultiplyzBD=xBD.multiply(BigDecimal(z));  % multiply input requires BD type\r\n  \r\n  To convert java to string of unlimited length can be achieved via java toString or Matlab char\r\n  \r\n  xstr=toString(xBD)  or xstr=char(xBD) \r\n\r\n*Input:* X,Y, function_case  [X,Y double or str, function 1:X+Y, 2:X*Y, 3: X^Y(double)\r\n\r\n*Output:* z  (char variable)\r\n\r\n*Future Challenges:*\r\n\r\n  1. nchoosek_large (full precision)\r\n  2. Next Prime\r\n  3. factor_large\r\n\r\n4. \u003chttp://www.mathworks.com/matlabcentral/cody/problems/1854-factorial-unlimited-size-java-math Factorial\u003e","description_html":"\u003cp\u003eThis challenge is an introduction to the wonderful word of java.math that allows unlimited precision calculations.  The primary reference sites are \u003ca href = \"http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Number.html\"\u003eJava Math\u003c/a\u003e, \u003ca href = \"http://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigDecimal.html\"\u003eJava BigDecimal\u003c/a\u003e, and \u003ca href = \"http://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigInteger.html\"\u003eJava BigInteger\u003c/a\u003e.\u003c/p\u003e\u003cp\u003eThe usage of BigDecimal functions add, multiply, and pow will be tested.\u003c/p\u003e\u003cp\u003eJava Math tutorial: (Simplified summary that is believed correct)\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003evd-decimal value, vstr-string, vi-integer value \r\nxBD=java.math.BigDecimal(vd);  % valid vd,vstr,vi creates xBD a BigDecimal variable\r\nimport java.math.*;  % simplifies statements\r\nxBD=BigDecimal(vstr);\r\nx2pwrBD=xBD.pow(vi); % Invalid: vd,vstr,BD\r\nxplusyBD=xBD.add(BigDecimal(y)); % add input requires BD type\r\nxmultiplyzBD=xBD.multiply(BigDecimal(z));  % multiply input requires BD type\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eTo convert java to string of unlimited length can be achieved via java toString or Matlab char\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003exstr=toString(xBD)  or xstr=char(xBD) \r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003eInput:\u003c/b\u003e X,Y, function_case  [X,Y double or str, function 1:X+Y, 2:X*Y, 3: X^Y(double)\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput:\u003c/b\u003e z  (char variable)\u003c/p\u003e\u003cp\u003e\u003cb\u003eFuture Challenges:\u003c/b\u003e\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e1. nchoosek_large (full precision)\r\n2. Next Prime\r\n3. factor_large\r\n\u003c/pre\u003e\u003cp\u003e4. \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/1854-factorial-unlimited-size-java-math\"\u003eFactorial\u003c/a\u003e\u003c/p\u003e","function_template":"function zstr=java_math(x,y,select)\r\n import java.math.*\r\n\r\n switch select\r\n    case 1 % add x+y\r\n     zBD=x+y;\r\n    case 2 % multiply  x*y\r\n     zBD=x*y;\r\n    case 3 % power  x^y\r\n     zBD=x^y;\r\n     \r\n end\r\n zstr=char(zBD);\r\n\r\nend","test_suite":"%%\r\nx=2;\r\ny=64;\r\n% power\r\nzstr=java_math(x,y,3);\r\nassert(strcmp(zstr,'18446744073709551616'),sprintf('zstr=%s\\n',zstr))\r\n%%\r\nxstr='18446744073709551615';\r\ny=3;\r\n%Add\r\nzstr=java_math(xstr,y,1);\r\nassert(strcmp(zstr,'18446744073709551618'),sprintf('zstr=%s\\n',zstr))\r\n%%\r\nx=2^53;  % largest eps==1 double\r\ny=2^11;\r\n%Multiply\r\nzstr=java_math(x,y,2);\r\nassert(strcmp(zstr,'18446744073709551616'),sprintf('zstr=%s\\n',zstr))\r\n%%\r\nx=2^53;  % largest valid double\r\ny=2^12;\r\n% Multiply\r\nzstr=java_math(x,y,2);\r\nassert(strcmp(zstr,'36893488147419103232'),sprintf('zstr=%s\\n',zstr))\r\n%%\r\nx=randi(10);\r\ny=randi(100);\r\nzstr=java_math(x,y,1);\r\nassert(strcmp(zstr,num2str(x+y)),sprintf('x=%2i y=%3i x+y=%5i zstr=%s\\n',x,y,x+y,zstr))\r\n%%\r\nx=randi(10);\r\ny=randi(100);\r\nzstr=java_math(x,y,2);\r\nassert(strcmp(zstr,num2str(x*y)),sprintf('x=%2i y=%3i x*y=%5i zstr=%s\\n',x,y,x*y,zstr))\r\n%%\r\nx=randi(20);\r\ny=randi(5);\r\nzstr=java_math(x,y,3);\r\nassert(strcmp(zstr,num2str(x^y)),sprintf('x=%2i y=%3i x^y=%8i zstr=%s\\n',x,y,x^y,zstr))\r\n\r\n\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":3,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":37,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-08-18T17:42:26.000Z","updated_at":"2025-12-10T01:06:03.000Z","published_at":"2013-08-18T19:02:27.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis challenge is an introduction to the wonderful word of java.math that allows unlimited precision calculations. The primary reference sites are\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Number.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eJava Math\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigDecimal.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eJava BigDecimal\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigInteger.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eJava BigInteger\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe usage of BigDecimal functions add, multiply, and pow will be tested.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eJava Math tutorial: (Simplified summary that is believed correct)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[vd-decimal value, vstr-string, vi-integer value \\nxBD=java.math.BigDecimal(vd);  % valid vd,vstr,vi creates xBD a BigDecimal variable\\nimport java.math.*;  % simplifies statements\\nxBD=BigDecimal(vstr);\\nx2pwrBD=xBD.pow(vi); % Invalid: vd,vstr,BD\\nxplusyBD=xBD.add(BigDecimal(y)); % add input requires BD type\\nxmultiplyzBD=xBD.multiply(BigDecimal(z));  % multiply input requires BD type\\n\\nTo convert java to string of unlimited length can be achieved via java toString or Matlab char\\n\\nxstr=toString(xBD)  or xstr=char(xBD)]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eInput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e X,Y, function_case [X,Y double or str, function 1:X+Y, 2:X*Y, 3: X^Y(double)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e z (char variable)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eFuture Challenges:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[1. nchoosek_large (full precision)\\n2. Next Prime\\n3. factor_large]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e4.\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/1854-factorial-unlimited-size-java-math\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eFactorial\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":1855,"title":"Usage of java.math : N Choose K with unlimited precision","description":"Calculate the binomial coefficient nchoosek with full accuracy. This challenge may use the wonderful word of java.math that allows unlimited precision calculations.  The primary reference sites are \u003chttp://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Number.html Java Math\u003e, \u003chttp://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigDecimal.html Java BigDecimal\u003e, and \u003chttp://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigInteger.html Java BigInteger\u003e.\r\n\r\nThe usage of BigDecimal functions add, multiply, and divide may be required.\r\n\r\nJava Math:\r\n\r\n  vd-decimal value, vstr-string, vi-integer value \r\n  xBD=java.math.BigDecimal(vd);  % valid vd,vstr,vi creates xBD a BigDecimal variable\r\n  import java.math.*;  % simplifies statements\r\n  xBD=BigDecimal(vstr);\r\n  xplusyBD=xBD.add(BigDecimal(y)); % add input requires BD type\r\n  xmultiplyzBD=xBD.multiply(BigDecimal(z));  % multiply input requires BD type\r\n  xdividezBD=xBD.divide(BigDecimal(z));  % divide input requires BD type\r\n  xmultydivz=xBD.multiply(yBD).divide(zBD);  out=x*y/z\r\n  \r\n  To convert java to string of unlimited length can be achieved via java toString or Matlab char\r\n  \r\n  xstr=toString(xBD)  or xstr=char(xBD) \r\n\r\n*Input:* [N,K]  [ Inputs to nchoosek(N,K) 0\u003c=K\u003c=N\u003c200 ]\r\n\r\n*Output:* C  (char variable of C=nchoosek(n,k) or BigDecimal variable type )\r\n\r\n*Theory:*\r\n\r\n\u003chttp://en.wikipedia.org/wiki/Binomial_coefficient C(n,k)\u003e link shows multiple evaluation methods.\r\n\r\nC(n,k)= n!/(k!(n-k)!)\r\n\r\n\u003c\u003chttp://upload.wikimedia.org/math/b/1/a/b1a5828ee5ec18a1362999a76f3c63e6.png\u003e\u003e\r\n\r\nThe factorial method gives a direct solution while the multiplicative may require fewer operations. \r\n\r\n*Hint:* C(5,3)=(5/3)*(4/2)*(3/1)= (5/1)*(4/2)*(3/3); numerator has k terms\r\n\r\n*Future Challenges:*\r\n\r\n1. \u003chttp://www.mathworks.com/matlabcentral/cody/problems/1833-usage-of-java-math-add-multiply-pow Usage of java.math\u003e\r\n\r\n  2. nchoosek_large (full precision)\r\n  3. Next Prime\r\n  4. factor_large\r\n\r\n5. \u003chttp://www.mathworks.com/matlabcentral/cody/problems/1854-factorial-unlimited-size-java-math Factorial\u003e","description_html":"\u003cp\u003eCalculate the binomial coefficient nchoosek with full accuracy. This challenge may use the wonderful word of java.math that allows unlimited precision calculations.  The primary reference sites are \u003ca href = \"http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Number.html\"\u003eJava Math\u003c/a\u003e, \u003ca href = \"http://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigDecimal.html\"\u003eJava BigDecimal\u003c/a\u003e, and \u003ca href = \"http://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigInteger.html\"\u003eJava BigInteger\u003c/a\u003e.\u003c/p\u003e\u003cp\u003eThe usage of BigDecimal functions add, multiply, and divide may be required.\u003c/p\u003e\u003cp\u003eJava Math:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003evd-decimal value, vstr-string, vi-integer value \r\nxBD=java.math.BigDecimal(vd);  % valid vd,vstr,vi creates xBD a BigDecimal variable\r\nimport java.math.*;  % simplifies statements\r\nxBD=BigDecimal(vstr);\r\nxplusyBD=xBD.add(BigDecimal(y)); % add input requires BD type\r\nxmultiplyzBD=xBD.multiply(BigDecimal(z));  % multiply input requires BD type\r\nxdividezBD=xBD.divide(BigDecimal(z));  % divide input requires BD type\r\nxmultydivz=xBD.multiply(yBD).divide(zBD);  out=x*y/z\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eTo convert java to string of unlimited length can be achieved via java toString or Matlab char\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003exstr=toString(xBD)  or xstr=char(xBD) \r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003eInput:\u003c/b\u003e [N,K]  [ Inputs to nchoosek(N,K) 0\u0026lt;=K\u0026lt;=N\u0026lt;200 ]\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput:\u003c/b\u003e C  (char variable of C=nchoosek(n,k) or BigDecimal variable type )\u003c/p\u003e\u003cp\u003e\u003cb\u003eTheory:\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://en.wikipedia.org/wiki/Binomial_coefficient\"\u003eC(n,k)\u003c/a\u003e link shows multiple evaluation methods.\u003c/p\u003e\u003cp\u003eC(n,k)= n!/(k!(n-k)!)\u003c/p\u003e\u003cimg src = \"http://upload.wikimedia.org/math/b/1/a/b1a5828ee5ec18a1362999a76f3c63e6.png\"\u003e\u003cp\u003eThe factorial method gives a direct solution while the multiplicative may require fewer operations.\u003c/p\u003e\u003cp\u003e\u003cb\u003eHint:\u003c/b\u003e C(5,3)=(5/3)*(4/2)*(3/1)= (5/1)*(4/2)*(3/3); numerator has k terms\u003c/p\u003e\u003cp\u003e\u003cb\u003eFuture Challenges:\u003c/b\u003e\u003c/p\u003e\u003cp\u003e1. \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/1833-usage-of-java-math-add-multiply-pow\"\u003eUsage of java.math\u003c/a\u003e\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e2. nchoosek_large (full precision)\r\n3. Next Prime\r\n4. factor_large\r\n\u003c/pre\u003e\u003cp\u003e5. \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/1854-factorial-unlimited-size-java-math\"\u003eFactorial\u003c/a\u003e\u003c/p\u003e","function_template":"function y = nchoosekJava(N,K)\r\n  y = num2str(nchoosek(N,K));\r\nend","test_suite":"%%\r\ntic\r\nN=5;K=2;\r\nNK=nchoosekJava(N,K);\r\ntoc\r\nassert(strcmp(NK,num2str(nchoosek(N,K))))\r\n%%\r\ntic\r\nN=randi(10);\r\nK=randi(N);\r\nNK=nchoosekJava(N,K);\r\ntoc\r\nassert(strcmp(NK,num2str(nchoosek(N,K))))\r\n%%\r\ntic\r\nN=100;\r\nK=50;\r\nNK=nchoosekJava(N,K);\r\ntoc\r\nassert(strcmp(NK,'100891344545564193334812497256'))\r\n%%\r\ntic\r\nN=200;\r\nK=75;\r\nNK=nchoosekJava(N,K);\r\ntoc\r\nassert(strcmp(NK,'168849997346404286704489530268603459022868706883102845056'))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":52,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-08-30T03:09:06.000Z","updated_at":"2026-02-08T19:48:26.000Z","published_at":"2013-08-30T03:48:17.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/media/image1.png\"}],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCalculate the binomial coefficient nchoosek with full accuracy. This challenge may use the wonderful word of java.math that allows unlimited precision calculations. The primary reference sites are\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Number.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eJava Math\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigDecimal.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eJava BigDecimal\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigInteger.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eJava BigInteger\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe usage of BigDecimal functions add, multiply, and divide may be required.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eJava Math:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[vd-decimal value, vstr-string, vi-integer value \\nxBD=java.math.BigDecimal(vd);  % valid vd,vstr,vi creates xBD a BigDecimal variable\\nimport java.math.*;  % simplifies statements\\nxBD=BigDecimal(vstr);\\nxplusyBD=xBD.add(BigDecimal(y)); % add input requires BD type\\nxmultiplyzBD=xBD.multiply(BigDecimal(z));  % multiply input requires BD type\\nxdividezBD=xBD.divide(BigDecimal(z));  % divide input requires BD type\\nxmultydivz=xBD.multiply(yBD).divide(zBD);  out=x*y/z\\n\\nTo convert java to string of unlimited length can be achieved via java toString or Matlab char\\n\\nxstr=toString(xBD)  or xstr=char(xBD)]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eInput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e [N,K] [ Inputs to nchoosek(N,K) 0\u0026lt;=K\u0026lt;=N\u0026lt;200 ]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e C (char variable of C=nchoosek(n,k) or BigDecimal variable type )\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eTheory:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://en.wikipedia.org/wiki/Binomial_coefficient\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eC(n,k)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e link shows multiple evaluation methods.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eC(n,k)= n!/(k!(n-k)!)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe factorial method gives a direct solution while the multiplicative may require fewer operations.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eHint:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e C(5,3)=(5/3)*(4/2)*(3/1)= (5/1)*(4/2)*(3/3); numerator has k terms\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eFuture Challenges:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e1.\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/1833-usage-of-java-math-add-multiply-pow\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUsage of java.math\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[2. nchoosek_large (full precision)\\n3. Next Prime\\n4. factor_large]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e5.\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/1854-factorial-unlimited-size-java-math\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eFactorial\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"},{\"partUri\":\"/media/image1.png\",\"contentType\":\"image/png\",\"content\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAiQAAAA6BAMAAABynl+BAAAAMFBMVEX///9iYmIEBASenp5AQEAwMDCKioq2trYiIiJ0dHQMDAzm5uYWFhZQUFDMzMwAAAAm8IwaAAAAAXRSTlMAQObYZgAACIxJREFUeNrtWmtsVMcVPnv3ce0uXtutCKW08aKoeRWSjairFJritCQ/EkRXalOaWA0kCqWgAAsCpIAqFvEjVaq0C1FABLXZKMqPqE1rU9OkqaLYNJES+lolQQgiipUoEaY1YIMB26y3M2fu3fs6M95ZbygyPtLdvd5v5juzZ2fOnDufASalRbphyrxW31Z9X2NyhqSUnAqJz0aWPjsVEq9t+V1yYgT94q1r8uSrz384sf6Jv4n3WLaqfHW9DNijhPdUzBXqVVCQNLBji/IbXz/ekF63XR6Wk9QtlyExEomzEEY7JLD5wdMWWhHXTwBOnpc5oGgAzjbWKyLC3CR+FfiNZ7i43rVvpjXJc86rsnz1Cb2Y2YxLpCXweqjrFmglXNjwgswBRQOJbMMeRUi4m0Z/9OM3WVwsvTa8Wt66ZlSRrzZQHx54lL0MhiXwv6D0TYFWwnWReTajMgcUDQxmz61ShIS7yfhDOXTU4drmTL0vV5Gv6Lwb5XmpVQLPZQMQaCVc03g6yUsdtOonT+7mSxTQas2SJU68Ps3JWNY/L8u7ipx8TAKzSR1GtCKun/Psk5c5IGjGLW25m9UyPohA7DaWbxoHnjn4Els5REgeOTNzzqz0mpb6iyTA60RxF+xaTBUYbJM79i1IDCNK1JxBrkEekmTn4x+TDggaapiB0nbDk7E3U+70Y7bnBJcBkQfYb9Z/90petJWIPH37B2YmmciN/ZIEINJk3wVteDmHbXLPqOYj6i9+SK67+cpvPzGXdkDQUMP0uzGjvz/nCWXpUsHiMmATa9/6xkzAkHUGGMPt7+XCVL4SAFxos++InbuNw2Vyd4K7B1Gf0VyPsWvfWGY97YCgoYbpcwMjHUdMz/56a7FgcYVgMS9aF/bAjXwhbesMzMJwf5Px8B/OYtsgkG8csO/Y5MMC5yCfpdGtbMGGFnZz2CY/jXN9On/9612IQryPJc83t1s3bi6n8Vk29KdiGZzdQQd4ecqFonN/R4EaHHdT98JSbOG4OdOTFlwR6OQx3Htz4jDf53Z8OxDmz+WgvycfAgkAHWn7Do6s5J//xdOKwRZ5AtHLuF382ob/zK7RXErcuLhcjePsWteS4WmOchBInpufGjnIbxaNbiw4w3T3ZW7Mk08+AZ4x9dn5JhLGIqgPSm9jiIO1M0u5/WnyARyBcymnySz/BCsgbJEP/rYMNOfNYY7C0PfZX/eCdePicjWex1a+MYBLj3CAl6e++MX8++7B8UV2ucfv9OVuMi2nwDumJRYfGCGcZ9+AYoEvrdK/g4txOfwjRK5SBOpy8iahNMI2uVNQb4EYov7UQHKxX3PkJcj+iXZA0HS4tiqKkLvZl74U9+Tl8KF6i8uI8cCEhyHaznfruksBt6kcPPAaFRIBjCbpJjxRRZs4XCYv2+btzW8h6jOaaz8vS4r5Y7QDgma88XM3q+HYmKfWieV2WVwGvsbSMHYjT2BDYwFKtke/v5TyJYBIB9Wk4aFWXu7mOFwmL9sfT5/+KqL+TZjkWsCA1MjOAu2AoBlv/NzNd2Fvgzcr1z9rc23zMv5dtxSM5+XYGiW8pkKu15UOCJplwyLXndUeMnIZSS++QzckQy/KsdlKeHaFXPellBSzoXZDRi6jzXveUOjVdbBJipj7VTCilXCZaRUFRVPtkC2u73k/fT6jyx+WpreoEo5WzHWHygFBM97CkY5JcBnzvJ8WtM9Yiw/LkN1KeHfFXId7FRS7qzhZlY1JcIUOeuvVhbN5bom8g0XdncFei3E37cpebefP7hEve87EWTLQVB3VSd9u34zUX5e17+qCq9LkI9a2gI6ThWvdIr6/Mzt9HzQ6SSokA/7PFlKBmsNkiy3iO/rJ+VfmQEiSSwZCV2su8X5H7WFGfM8m3dnMtZ5LIsd9HxSu8UwS/43hW2qpGoZEKVxqKqNXznYYOSzoy3pgR1BPRCx+iwarxbYiKREu16Iy+p2gConK6FpC0qz9cpWpeEPHjW4sVwezVppNJQONELus84gs2BKnAL4Y2OTXsSjU83LwRN7xatvqOVu7BeoL1fmarw9pGVc00mJUth64gGjEMbNOxyGyqYVLUoWUKKPxHyZrHZKhozLkeCTZgzf7PhUfzCIacayo9Tshm5nDE0Kv3R/dyl4/Yteqlx2vtvXD8GWB+p7mR69cLvmZURQr19ID44uJRhwb0polyKYWLkkVUqaMXknLG5fEoDfEm/leMxojGiE2V4cWe1jC5Veo9ZqyVEjhtWy2MvqZf+/EdPkhiGHgmbytB44NEwcriG3XcCh6qIVLUoWUKaN6lsZlZoIpb4Jypywk0RJ/s/VA6t+ABHaTxphED7VwSaqQMmVUawK0puNHOsB8BsLyCgflTln1OvQ0hnQsAzz7H3iB+M0Re0NnlmCPt9m3zRwBLjO5hEu08xloSJe9utFFdyHqKKP80rLzhwBufgLuXAHRn+6VffF3udwpfRL+pJdvlkIPhC8Q6VBgB3RCgj3GES4dFdKFBpVRVEd1bEw85/WoH/f60orDgX2PQFkPhHaqyEBMpzIQPdTCpUuFdKFBZfTezya/LlEdIZW+BmU9sP6fVJGBWF6nLMEeauGSVCFlymjNDeVOaUgu7oeyHhiaThYZDIu/rFWWcDa1cEmqkDJlNHDSNVFDuVMaEtjl6IE/oo6gBJbVcCh6qIVLUoWUKaOHX/xxR01DIuROqTl7XvyGWrpVC5dayqie/df+Yr3VhYutq/L/xY28UsuQqIVLLWVUz1qsxXGoeooN9qR8vLbP39K1ZvJ5+ZoSrcnqqHqWwE4rnYV/UNvn705p6cCrr/ubVOhEDvOWTDCS/CFso3WWUWMZQilc6imjOramLr6IWRtMWdmSE184k8zqJ3i2EJl8ISn1xeezPPWf7qn1Uk6v11m7RcuDU8Gojf0PBYku0k/USjQAAAAASUVORK5CYII=\"}]}"},{"id":55705,"title":"AZPC Oddly Triangular: N=10/11/13/14 Digits 3/7/9  Part 3 of 5","description":"AZPC created the Oddly Triangular contest on 9/7/22. The challenge is to find the longest sequence of N odd digits such that sum(1:value)  is composed of only odd digits. The contest ended on 9/8/22 as Rokicki created a 3.6 million digit solution with the implication that an infinite length pattern had been determined. [N=2, 17, sum(1:17)=153]\r\nThis is step three of the steps and processing types to find Rokicki's result.\r\nThis challenge is to find a solution subset with lengths 10, 11, 13, and 14 that only use the digits 3/7/9 in M and begin with 339 (10/11), 3399(13), and 33999(14). The sum(1:M(i)) may only use odd digits. Normal double variables will not suffice for N\u003e8 solutions as the eps is \u003e1 for the sums.\r\nUsage of matlab java math can be seen in the Test Suite. A function zcombvec is given in the function template to facilitate creation of all vectors that only use the 3/7/9 digits. Usage of zcombvec is not required.\r\nM=OddlyTri339_379(N,Q) where N=digit length, Q=number of solutions, M is a double vector of the Q values.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 246px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 123px; transform-origin: 407px 123px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eAZPC\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 40px 8px; transform-origin: 40px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e created the \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eOddly Triangular\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 270.5px 8px; transform-origin: 270.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e contest on 9/7/22. The challenge is to find the longest sequence of N odd digits such that sum(1:value)  is composed of only odd digits. The contest ended on 9/8/22 as Rokicki created a 3.6 million digit solution with the implication that an infinite length pattern had been determined. [N=2, 17, sum(1:17)=153]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 235.5px 8px; transform-origin: 235.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThis is step three of the steps and processing types to find Rokicki's result.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 384px 8px; transform-origin: 384px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThis challenge is to find a solution subset with lengths 10, 11, 13, and 14 that only use the digits 3/7/9 in M and begin with 339 (10/11), 3399(13), and 33999(14). The sum(1:M(i)) may only use odd digits. Normal double variables will not suffice for N\u0026gt;8 solutions as the eps is \u0026gt;1 for the sums.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 384px 8px; transform-origin: 384px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eUsage of matlab java math can be seen in the Test Suite. A function zcombvec is given in the function template to facilitate creation of all vectors that only use the 3/7/9 digits. Usage of zcombvec is not required.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 342px 8px; transform-origin: 342px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eM=OddlyTri339_379(N,Q) where N=digit length, Q=number of solutions, M is a double vector of the Q values.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function M=OddlyTri339_379(N,Q)\r\n% M starts with 339\r\n M=zeros(Q,1);\r\n  \r\nend\r\n\r\nfunction cc = zcombvec(old, new)\r\n% old: base matrix\r\n% new: column vector of new elements to augment combinations\r\n% cc: matrix of all combinations of old with new\r\n%{ \r\n Usage \r\n a=[3];\r\n b=[3;7;9];\r\n for ih=2:2\r\n  a=zcombvec(a,b);\r\n end\r\n results in [3 3;3 7; 3 9]\r\n%}\r\n mm = size(old,1);\r\n nn = size(new,1);\r\n cc = repmat(old, nn, 1);\r\n t=repmat(new', mm, 1);\r\n cc = [cc  t(:)];\r\nend %zcombvec\r\n\r\nfunction Nsum=sum1NJava(N)\r\n% 1+2+...+N= N*(N+1)/2  Nsum=sum(1:N)\r\n% N may be either string or real\r\n% No commas allowed in N if it is a string\r\n% Nsum char\r\n import java.math.*\r\n \r\n BD1=BigDecimal(1); % Create a BigDecimal Constant\r\n BD2=BigDecimal(2);\r\n \r\n numval=BigDecimal(N); % N\r\n numval1=numval.add(BD1); % N+1\r\n numval1d2=numval1.divide(BD2);\r\n m1m2=numval.multiply(numval1d2);\r\n Nsum=char(m1m2);\r\nend %sum1NJava","test_suite":"%%\r\nimport java.math.*\r\nBD1=BigDecimal(1); % Create a BigDecimal Constant\r\nBD2=BigDecimal(2);\r\ntic\r\nN = 10;\r\nQ = 1;\r\nvalid = 0;\r\nM=OddlyTri339_379(N,Q)\r\nM(M\u003c10^(N-1))=[]; %Verify digit lengths\r\nM(M\u003e=10^N)=[];\r\nM=unique(M);\r\nif length(M)==Q\r\n valid=prod(mod(prod(num2str(M)-'0',2),2));\r\n if valid % Now calc sums using java math infinite precision\r\n  numval=BigDecimal(M); % M\r\n  numval1=numval.add(BD1); % M+1\r\n  numval1d2=numval1.divide(BD2); %(M+1)/2\r\n  m1m2=numval.multiply(numval1d2); %M*(M+1)/2\r\n  Msum=char(m1m2); %Convert Java variable to a string\r\n  if nnz(Msum=='0')\u003e0,valid=0;end % Check for any Even digits in sum\r\n  if nnz(Msum=='2')\u003e0,valid=0;end\r\n  if nnz(Msum=='4')\u003e0,valid=0;end\r\n  if nnz(Msum=='6')\u003e0,valid=0;end\r\n  if nnz(Msum=='8')\u003e0,valid=0;end\r\n end\r\nend % length(M)==Q\r\nif valid\r\n fprintf('Valid set\\n')\r\n for i=1:length(M)\r\n  %fprintf('%i\\n',M(i))\r\n  fprintf('%i %s\\n',M(i),Msum)\r\n end\r\nelse\r\n fprintf('Not Valid set: Q %i required\\n',Q)\r\n for i=1:length(M)\r\n  fprintf('%i %s\\n',M(i),Msum)\r\n end\r\nend\r\n\r\nassert(isequal(valid,1))\r\ntoc\r\n%%\r\nimport java.math.*\r\nBD1=BigDecimal(1); % Create a BigDecimal Constant\r\nBD2=BigDecimal(2);\r\ntic\r\nN = 11;\r\nQ = 2;\r\nMsumc{Q}='';\r\nvalid = 0;\r\nM=OddlyTri339_379(N,Q)\r\nM(M\u003c10^(N-1))=[]; %Verify digit lengths\r\nM(M\u003e=10^N)=[];\r\nM=unique(M);\r\nif length(M)==Q\r\n valid=1;\r\n for i=1:Q\r\n  valid=valid*prod(mod(prod(num2str(M(i))-'0',2),2));\r\n  if valid % Now calc sums using java math infinite precision\r\n   numval=BigDecimal(M(i)); % M\r\n   numval1=numval.add(BD1); % M+1\r\n   numval1d2=numval1.divide(BD2); %(M+1)/2\r\n   m1m2=numval.multiply(numval1d2); %M*(M+1)/2\r\n   Msum=char(m1m2); %Convert Java variable to a string\r\n   if nnz(Msum=='0')\u003e0,valid=0;end % Check for any Even digits in sum\r\n   if nnz(Msum=='2')\u003e0,valid=0;end\r\n   if nnz(Msum=='4')\u003e0,valid=0;end\r\n   if nnz(Msum=='6')\u003e0,valid=0;end\r\n   if nnz(Msum=='8')\u003e0,valid=0;end\r\n   Msumc{i}=Msum;\r\n  end\r\n end % for i 1:Q\r\nend % length(M)==Q\r\nif valid\r\n fprintf('Valid set\\n')\r\n for i=1:length(M)\r\n  %fprintf('%i\\n',M(i))\r\n  fprintf('%i %s\\n',M(i),Msumc{i})\r\n end\r\nelse\r\n fprintf('Not Valid set: Q %i required\\n',Q)\r\n for i=1:length(M)\r\n  fprintf('%i %s\\n',M(i),Msumc{i})\r\n end\r\nend\r\n\r\nassert(isequal(valid,1))\r\ntoc\r\n%%\r\nimport java.math.*\r\nBD1=BigDecimal(1); % Create a BigDecimal Constant\r\nBD2=BigDecimal(2);\r\ntic\r\nN = 13;\r\nQ = 3;\r\nMsumc{Q}='';\r\nvalid = 0;\r\nM=OddlyTri339_379(N,Q)\r\nM(M\u003c10^(N-1))=[]; %Verify digit lengths\r\nM(M\u003e=10^N)=[];\r\nM=unique(M);\r\nif length(M)==Q\r\n valid=1;\r\n for i=1:Q\r\n  valid=valid*prod(mod(prod(num2str(M(i))-'0',2),2));\r\n  if valid % Now calc sums using java math infinite precision\r\n   numval=BigDecimal(M(i)); % M\r\n   numval1=numval.add(BD1); % M+1\r\n   numval1d2=numval1.divide(BD2); %(M+1)/2\r\n   m1m2=numval.multiply(numval1d2); %M*(M+1)/2\r\n   Msum=char(m1m2); %Convert Java variable to a string\r\n   if nnz(Msum=='0')\u003e0,valid=0;end % Check for any Even digits in sum\r\n   if nnz(Msum=='2')\u003e0,valid=0;end\r\n   if nnz(Msum=='4')\u003e0,valid=0;end\r\n   if nnz(Msum=='6')\u003e0,valid=0;end\r\n   if nnz(Msum=='8')\u003e0,valid=0;end\r\n   Msumc{i}=Msum;\r\n  end\r\n end % for i 1:Q\r\nend % length(M)==Q\r\nif valid\r\n fprintf('Valid set\\n')\r\n for i=1:length(M)\r\n  %fprintf('%i\\n',M(i))\r\n  fprintf('%i %s\\n',M(i),Msumc{i})\r\n end\r\nelse\r\n fprintf('Not Valid set: Q %i required\\n',Q)\r\n for i=1:length(M)\r\n  fprintf('%i %s\\n',M(i),Msumc{i})\r\n end\r\nend\r\n\r\nassert(isequal(valid,1))\r\ntoc\r\n%%\r\nimport java.math.*\r\nBD1=BigDecimal(1); % Create a BigDecimal Constant\r\nBD2=BigDecimal(2);\r\ntic\r\nN = 14;\r\nQ = 1;\r\nMsumc{Q}='';\r\nvalid = 0;\r\nM=OddlyTri339_379(N,Q)\r\nM(M\u003c10^(N-1))=[]; %Verify digit lengths\r\nM(M\u003e=10^N)=[];\r\nM=unique(M);\r\nif length(M)==Q\r\n valid=1;\r\n for i=1:Q\r\n  valid=valid*prod(mod(prod(num2str(M(i))-'0',2),2));\r\n  if valid % Now calc sums using java math infinite precision\r\n   numval=BigDecimal(M(i)); % M\r\n   numval1=numval.add(BD1); % M+1\r\n   numval1d2=numval1.divide(BD2); %(M+1)/2\r\n   m1m2=numval.multiply(numval1d2); %M*(M+1)/2\r\n   Msum=char(m1m2); %Convert Java variable to a string\r\n   if nnz(Msum=='0')\u003e0,valid=0;end % Check for any Even digits in sum\r\n   if nnz(Msum=='2')\u003e0,valid=0;end\r\n   if nnz(Msum=='4')\u003e0,valid=0;end\r\n   if nnz(Msum=='6')\u003e0,valid=0;end\r\n   if nnz(Msum=='8')\u003e0,valid=0;end\r\n   Msumc{i}=Msum;\r\n  end\r\n end % for i 1:Q\r\nend % length(M)==Q\r\nif valid\r\n fprintf('Valid set\\n')\r\n for i=1:length(M)\r\n  %fprintf('%i\\n',M(i))\r\n  fprintf('%i %s\\n',M(i),Msumc{i})\r\n end\r\nelse\r\n fprintf('Not Valid set: Q %i required\\n',Q)\r\n for i=1:length(M)\r\n  fprintf('%i %s\\n',M(i),Msumc{i})\r\n end\r\nend\r\n\r\nassert(isequal(valid,1))\r\ntoc","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":3097,"edited_by":3097,"edited_at":"2022-09-14T03:33:27.000Z","deleted_by":null,"deleted_at":null,"solvers_count":5,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2022-09-13T23:14:10.000Z","updated_at":"2022-09-14T03:33:28.000Z","published_at":"2022-09-14T03:33:28.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eAZPC\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e created the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eOddly Triangular\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e contest on 9/7/22. The challenge is to find the longest sequence of N odd digits such that sum(1:value)  is composed of only odd digits. The contest ended on 9/8/22 as Rokicki created a 3.6 million digit solution with the implication that an infinite length pattern had been determined. [N=2, 17, sum(1:17)=153]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis is step three of the steps and processing types to find Rokicki's result.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis challenge is to find a solution subset with lengths 10, 11, 13, and 14 that only use the digits 3/7/9 in M and begin with 339 (10/11), 3399(13), and 33999(14). The sum(1:M(i)) may only use odd digits. Normal double variables will not suffice for N\u0026gt;8 solutions as the eps is \u0026gt;1 for the sums.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eUsage of matlab java math can be seen in the Test Suite. A function zcombvec is given in the function template to facilitate creation of all vectors that only use the 3/7/9 digits. Usage of zcombvec is not required.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eM=OddlyTri339_379(N,Q) where N=digit length, Q=number of solutions, M is a double vector of the Q values.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":55695,"title":"AZPC Oddly Triangular: N=8/9 Digits 3/7/9  Part 2 of 5","description":"AZPC created the Oddly Triangular contest on 9/7/22. The challenge is to find the longest sequence of N odd digits such that sum(1:value)  is composed of only odd digits. The contest ended on 9/8/22 as Rokicki created a 3.6 million digit solution with the implication that an infinite length pattern had been determined. [N=2, 17, sum(1:17)=153]\r\nThis is step two of the steps and processing types to find Rokicki's result.\r\nThis challenge is to find a solution subset with lengths 8 and 9 that only use the digits 3/7/9 in M. The sum(1:M(i)) may only use odd digits. Normal double variables will not suffice for the N=9 solution as the eps is 8 for the sum. There are 8 length 8 solutions if all odd digits are allowed. Rokicki focused on patterns using only 3/7/9 to reduce his search space.\r\nUsage of matlab java math can be seen in the Test Suite. A function zcombvec is given in the function template to facilitate creation of all vectors that only use the 3/7/9 digits. Usage of zcombvec is not required.\r\nM=OddlyTri_379(N,Q) where N=digit length, Q=number of solutions, M is a double vector of the Q values.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 246px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 123px; transform-origin: 407px 123px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eAZPC\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 40px 8px; transform-origin: 40px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e created the \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eOddly Triangular\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 270.5px 8px; transform-origin: 270.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e contest on 9/7/22. The challenge is to find the longest sequence of N odd digits such that sum(1:value)  is composed of only odd digits. The contest ended on 9/8/22 as Rokicki created a 3.6 million digit solution with the implication that an infinite length pattern had been determined. [N=2, 17, sum(1:17)=153]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 229.5px 8px; transform-origin: 229.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThis is step two of the steps and processing types to find Rokicki's result.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 372.5px 8px; transform-origin: 372.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThis challenge is to find a solution subset with lengths 8 and 9 that only use the digits 3/7/9 in M. The sum(1:M(i)) may only use odd digits. Normal double variables will not suffice for the N=9 solution as the eps is 8 for the sum. There are 8 length 8 solutions if all odd digits are allowed. Rokicki focused on patterns using only 3/7/9 to reduce his search space.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 384px 8px; transform-origin: 384px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eUsage of matlab java math can be seen in the Test Suite. A function zcombvec is given in the function template to facilitate creation of all vectors that only use the 3/7/9 digits. Usage of zcombvec is not required.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 330px 8px; transform-origin: 330px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eM=OddlyTri_379(N,Q) where N=digit length, Q=number of solutions, M is a double vector of the Q values.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function M=OddlyTri_379(N,Q)\r\n M=zeros(Q,1);\r\n  \r\nend\r\n\r\nfunction cc = zcombvec(old, new)\r\n% old: base matrix\r\n% new: column vector of new elements to augment combinations\r\n% cc: matrix of all combinations of old with new\r\n%{ \r\n Usage \r\n a=[3];\r\n b=[3;7;9];\r\n for ih=2:2\r\n  a=zcombvec(a,b);\r\n end\r\n results in [3 3;3 7; 3 9]\r\n%}\r\n mm = size(old,1);\r\n nn = size(new,1);\r\n cc = repmat(old, nn, 1);\r\n t=repmat(new', mm, 1);\r\n cc = [cc  t(:)];\r\nend %zcombvec\r\n\r\nfunction Nsum=sum1NJava(N)\r\n% 1+2+...+N= N*(N+1)/2  Nsum=sum(1:N)\r\n% N may be either string or real\r\n% No commas allowed in N if it is a string\r\n% Nsum char\r\n import java.math.*\r\n \r\n BD1=BigDecimal(1); % Create a BigDecimal Constant\r\n BD2=BigDecimal(2);\r\n \r\n numval=BigDecimal(N); % N\r\n numval1=numval.add(BD1); % N+1\r\n numval1d2=numval1.divide(BD2);\r\n m1m2=numval.multiply(numval1d2);\r\n Nsum=char(m1m2);\r\nend %sum1NJava","test_suite":"%%\r\ntic\r\nN = 8;\r\nQ = 2;\r\nvalid = 0;\r\nM=OddlyTri_379(N,Q)\r\nM(M\u003c10^(N-1))=[]; %Verify digit lengths\r\nM(M\u003e=10^N)=[];\r\nM=unique(M);\r\nif length(M)==Q\r\n valid=prod(mod(prod(num2str(M)-'0',2),2));\r\n if valid % Now calc sums\r\n  Msum=M.*(M+1)/2;\r\n  for i=1:length(M)\r\n   valid=valid*prod(mod(prod(num2str(Msum(i))-'0',2),2));\r\n  end\r\n end\r\nend % length(M)==Q\r\nif valid\r\n fprintf('Valid set\\n')\r\n for i=1:length(M)\r\n  fprintf('%i\\n',M(i))\r\n end\r\nelse\r\n fprintf('Not Valid set: Q %i required\\n',Q)\r\n for i=1:length(M)\r\n  fprintf('%i %i\\n',M(i),M(i)*(M(i)+1)/2)\r\n end\r\nend\r\n\r\nassert(isequal(valid,1))\r\ntoc\r\n%%\r\nimport java.math.*\r\nBD1=BigDecimal(1); % Create a BigDecimal Constant\r\nBD2=BigDecimal(2);\r\ntic\r\nN = 9;\r\nQ = 1;\r\nvalid = 0;\r\nM=OddlyTri_379(N,Q)\r\nM(M\u003c10^(N-1))=[]; %Verify digit lengths\r\nM(M\u003e=10^N)=[];\r\nM=unique(M);\r\nif length(M)==Q\r\n valid=prod(mod(prod(num2str(M)-'0',2),2));\r\n if valid % Now calc sums using java math infinite precision\r\n  numval=BigDecimal(M); % M\r\n  numval1=numval.add(BD1); % M+1\r\n  numval1d2=numval1.divide(BD2); %(M+1)/2\r\n  m1m2=numval.multiply(numval1d2); %M*(M+1)/2\r\n  Msum=char(m1m2); %Convert Java variable to a string\r\n  if nnz(Msum=='0')\u003e0,valid=0;end % Check for any Even digits in sum\r\n  if nnz(Msum=='2')\u003e0,valid=0;end\r\n  if nnz(Msum=='4')\u003e0,valid=0;end\r\n  if nnz(Msum=='6')\u003e0,valid=0;end\r\n  if nnz(Msum=='8')\u003e0,valid=0;end\r\n end\r\nend % length(M)==Q\r\nif valid\r\n fprintf('Valid set\\n')\r\n for i=1:length(M)\r\n  %fprintf('%i\\n',M(i))\r\n  fprintf('%i %s\\n',M(i),Msum)\r\n end\r\nelse\r\n fprintf('Not Valid set: Q %i required\\n',Q)\r\n for i=1:length(M)\r\n  fprintf('%i %s\\n',M(i),Msum)\r\n end\r\nend\r\n\r\nassert(isequal(valid,1))\r\ntoc","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":3097,"edited_by":3097,"edited_at":"2022-09-14T03:27:55.000Z","deleted_by":null,"deleted_at":null,"solvers_count":5,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2022-09-13T17:29:39.000Z","updated_at":"2022-09-14T03:27:56.000Z","published_at":"2022-09-14T03:27:56.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eAZPC\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e created the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eOddly Triangular\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e contest on 9/7/22. The challenge is to find the longest sequence of N odd digits such that sum(1:value)  is composed of only odd digits. The contest ended on 9/8/22 as Rokicki created a 3.6 million digit solution with the implication that an infinite length pattern had been determined. [N=2, 17, sum(1:17)=153]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis is step two of the steps and processing types to find Rokicki's result.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis challenge is to find a solution subset with lengths 8 and 9 that only use the digits 3/7/9 in M. The sum(1:M(i)) may only use odd digits. Normal double variables will not suffice for the N=9 solution as the eps is 8 for the sum. There are 8 length 8 solutions if all odd digits are allowed. Rokicki focused on patterns using only 3/7/9 to reduce his search space.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eUsage of matlab java math can be seen in the Test Suite. A function zcombvec is given in the function template to facilitate creation of all vectors that only use the 3/7/9 digits. Usage of zcombvec is not required.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eM=OddlyTri_379(N,Q) where N=digit length, Q=number of solutions, M is a double vector of the Q values.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":2325,"title":"GJam 2014 Rd 1c: Reordering Train Cars (Large)","description":"This Challenge is derived from \u003chttp://code.google.com/codejam/contest/3004486/dashboard#s=p1 GJam 2014 Rd 1c: Reordering Train Cars (Large)\u003e.\r\n\r\nDetermine number of sequences for set of strings under the constraint that all same characters must be contiguous. The large case could have 26! or more permutations.\r\n\r\n*Input:* s, string of N space separated string segments of letters [a..z]. 1\u003c=N\u003c=100. Total letters \u003c=100.\r\n\r\n*Output:* val, number of possible sequences, modulo 1,000,000,007\r\n\r\n*Example:*  Small Train Case examples \r\n\r\n  ab bbbc cd Val=1 as only abbbbccd can be created\r\n  aa aa bc c Val=4 aa gives 2 positions, aa'aa''bcc,aa''aa'bcc, bcccaa'aa'',bcccaa''aa'\r\n  abc bcd  Val=0 as c is internal and thus can not connect to c of abc\r\n\r\n*Theory:* \u003chttp://www.mathworks.com/matlabcentral/cody/problems/2324-gjam-2014-rd-1c-train-cars Train Small Spoilers\u003e\r\n\r\nLarge Case specific info. See \u003chttp://www.mathworks.com/matlabcentral/cody/problems/1833-usage-of-java-math-add-multiply-pow Usage of java math\u003e for unlimited precision. Note intValue gives more precision than floatValue. No java factorial exists so a function, non-recursive, is suggested. The small solution can be converted via java BigInteger factorial, mod, multiply, and intValue to solve the large case.\r\n\r\n\r\nAdditional GJam solutions can be found at \u003chttp://go-hero.net/jam Example GJam Matlab solutions\u003e. Select Find Solutions, change Language to Matlab. The Test Suite, at the bottom, contains a full GJam Small Matlab solution. No Valid Matlab solutions were submitted during the contest.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 408.3px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 204.15px; transform-origin: 407px 204.15px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 94.5333px 7.91667px; transform-origin: 94.5333px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThis Challenge is derived from\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.95px 7.91667px; transform-origin: 1.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"http://code.google.com/codejam/contest/3004486/dashboard#s=p1\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eGJam 2014 Rd 1c: Reordering Train Cars (Large)\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.95px 7.91667px; transform-origin: 1.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 373.783px 7.91667px; transform-origin: 373.783px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eDetermine number of sequences for set of strings under the constraint that all same characters must be contiguous. The large case could have 26! or more permutations.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 19.4333px 7.91667px; transform-origin: 19.4333px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eInput:\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 296.4px 7.91667px; transform-origin: 296.4px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e s, string of N space separated string segments of letters [a..z]. 1\u0026lt;=N\u0026lt;=100. Total letters \u0026lt;=100.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 25.2667px 7.91667px; transform-origin: 25.2667px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eOutput:\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 183.233px 7.91667px; transform-origin: 183.233px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e val, number of possible sequences, modulo 1,000,000,007\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 31.1167px 7.91667px; transform-origin: 31.1167px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eExample:\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 87.2667px 7.91667px; transform-origin: 87.2667px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e Small Train Case examples\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 61.3px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 404px 30.65px; transform-origin: 404px 30.65px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 184.8px 7.91667px; transform-origin: 184.8px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 11.55px 7.91667px; transform-origin: 11.55px 7.91667px; \"\u003eab \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 173.25px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 173.25px 7.91667px; \"\u003ebbbc cd Val=1 as only abbbbccd can be created\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 327.25px 7.91667px; transform-origin: 327.25px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 11.55px 7.91667px; transform-origin: 11.55px 7.91667px; \"\u003eaa \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 130.9px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 130.9px 7.91667px; \"\u003eaa bc c Val=4 aa gives 2 positions\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 184.8px 7.91667px; transform-origin: 184.8px 7.91667px; \"\u003e, aa'aa''bcc,aa''aa'bcc, bcccaa'aa'',bcccaa''aa'\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 261.8px 7.91667px; transform-origin: 261.8px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 15.4px 7.91667px; transform-origin: 15.4px 7.91667px; \"\u003eabc \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 11.55px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 11.55px 7.91667px; \"\u003ebcd\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 7.7px 7.91667px; transform-origin: 7.7px 7.91667px; \"\u003e  \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 227.15px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 227.15px 7.91667px; \"\u003eVal=0 as c is internal and thus can not connect to c of abc\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 25.6667px 7.91667px; transform-origin: 25.6667px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eTheory:\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.95px 7.91667px; transform-origin: 1.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"http://www.mathworks.com/matlabcentral/cody/problems/2324-gjam-2014-rd-1c-train-cars\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eTrain Small Spoilers\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 91.0333px 7.91667px; transform-origin: 91.0333px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eLarge Case specific info. See\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.95px 7.91667px; transform-origin: 1.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"http://www.mathworks.com/matlabcentral/cody/problems/1833-usage-of-java-math-add-multiply-pow\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eUsage of java math\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 199.05px 7.91667px; transform-origin: 199.05px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e for unlimited precision. Note intValue gives more precision than floatValue. No java factorial exists so a function, non-recursive, is suggested. The small solution can be converted via java BigInteger factorial, mod, multiply, and intValue to solve the large case.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 131.083px 7.91667px; transform-origin: 131.083px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eAdditional GJam solutions can be found at\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.95px 7.91667px; transform-origin: 1.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"http://go-hero.net/jam\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eExample GJam Matlab solutions\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 139.267px 7.91667px; transform-origin: 139.267px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. Select Find Solutions, change Language to Matlab. The Test Suite, at the bottom, contains a full GJam Small Matlab solution. No Valid Matlab solutions were submitted during the contest.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function val=train(s)\r\n% s is a string of strings separated by a space\r\n val=0;\r\n vstr=regexp(s,' ','split');\r\nend","test_suite":"%%\r\ns='wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww gggggggggggggg ddddddddddddddddddddddddddddddddddddddd ddddddddddddddddddddddddddddddd ddddddddddddddddddddddddddddd dddddddddddddddddddddddddddddddddddddddddddddddddddddddd ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd dddddddd dddddddddddddddddddddd dddddd dddddddddddddd dddddddddddddddddddddddddddddddddddddddddddd xxxxxxxttttttttteeeeeeppppppppppppllllllliiiiiiiifffffffffffffffmmmmmmmmmmmjjjjjjjhhhhhhhhhh uuuuuuuuubbbbbbcccccccvvvvvvvvvvkkkkkkqqqqqaaayyyyyyooooooooooonnnnnnnnnnnnrrrrrzz dddddddddddddddddddddddddddddddddddddddddddddddd ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd d ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd dddddddddddddddddddddddddddddddddddddddddddddddddddd ddddddddddddddd ddddddddddddddddddddddddddddddddddddddddd ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss ddddddddddddddddddddddddddddddd ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd';\r\nVexp=728878867;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='ggi aaaaaaayy iiiaaaaaaa lllllllgggggg iiiiiooooooooo';\r\nVexp=0;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='ssssssssssssssssssssbbbbbbbbbbbbbbbbbbbbbbbb ccccccccccc jjjjjjjjjjjjjjjjjjddddddddddddggggggggggggggggg qqqqqqqqqqqqffffffffffffffffffuuuuuuuuuuuuuuaaaaaaaaaaaaaaaaaa ccccccccccccccccccccccccccccccccccccccccc kkkkkkkkkkkkkkkmmmmmmmmmmmmmmmmjjjjjjjjjjjjjjjjj cccccccccccccccccccccccccccllllllllllllllllllllllllllkkkkkkkkkkkkkkkkkkkkkkkkkkkkk eeeeeeeeeeeeeeeeeeeeeeeeeecccccccccccccccccccc jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiieeeeeeeeeeeeeeeeeeeeeeeeee nnnnnnzzz bbbbbbbbbbbbbbbbrrrrrrrrrrrrrnnnnnnnnnnnn ggggggggggggggggggggggggggggggggggqqqqqqqqqqqqqqqqqqqqqqqqqqq hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh eeeeeeeeeeeeee zzzzzzzzzzzzzzz aaaaaaaaaaaaaaaaaaaaaaaaappppppppppppppppppppssssssssssssssssssssssss';\r\nVexp=2;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='kkkkkkkkkkkkkkkkkkkkk llllaaaaaa gggggggggggghhhhhhhhhhh lllllllllllllllllllllllllllllllllllllll bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb dddddddddddddddddddddddddddddddddddddddddyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy aaaaaaaaa vvvvvvvvvv yyyyyyyyy xxxxxxxx bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb gggggggggggggggggggggggggggg ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss iiiiiiiiiiimmmmmmmmmmmmmmmmmmmm vvvvvvvvvvvvvvvvvvvvvvvvv ssssssssssssssssssssssssssuuuuuuuuuuuuuuuuuuuuuuuuuuuuu vvvvvvvvvvvvvv uuuuuuuuuuuuuuuuuuuiiiiiiiiiiiiiiiiiiiiiiiiiiiiii tttttttttttttttttttteeeeeeeeeeeeeeeeeeeeeeeeee oooooooooooooooooooooooooooooooooooooooooooo nnnnnnnjjjjjjjjjjjjjjjddddddddddd oooooooooooooooooooooooooooooooooooooooooogggggggggggggggggggggggggggggggggggggggg nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk ooooooooooooooooooooooooooooooooo vvvvvvvvvvvvvvvvvvvvvvvv bwwwwwwwwoooooo sssssssssssssssssssssssssss nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv ffffffffffffffffffffffffffffffffffffff kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzbbbbbbbbbbbbbbbbbbbbbbbbbbb ooooooooooo kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx pppppppppppppppppppppppppppppppppppppppppppppppppppppppppp kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv qqqqlllll mmmmmmmmmmmtttttttt uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu ccccccccccccccccccckkkkkkk yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh aaaaaaaaaaannnnnnnnnnnnnnn ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk hhhhhhhhhhhhhhhhhhhhhhhhhhrrrrrrrrrrrrrrrrrrqqqqqqqqqqqqqqqqqq';\r\nVexp=265420800;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='rrrrrrrrjjjjjjjjnnnnnnnyyyyyyxxxxxlllltttttttt';\r\nVexp=1;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww wwwwwwwwww yy wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh yyyyyyyyyyyyyyyyyyyyyyyyyyyyyiiiiiiiiiiiiiiiiiiiiiiiiii ggggggggggggggggggggggggggggggggggggggggggghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa wwwwwwwwwwwwwwwwwwwwwwwww xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx vvvvvvvvvvvvvvvvvv aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaalllllllllllllllllllllllllllllllllllllllllllllllll aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv nnnnnnnnnnnttttttttttttttttkkkkkkkkkkkkkkkjjjjjjjjjjjjjooooooooooooooooooo bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb wwwwwwwwwwwwwwwwwwwwwwwwwww lllllllllllllllllllllllllllllllgggggggggggggggggggggggggggggg wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww uuuuuuuuuuuuuuuuuuuuuuuuuuuuu wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh yyyyyyyyyyyyyyyyy wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww mmmmmmmmmmmmeeeeeeeeeeeesssssssssdddddddddddzzzzzzzzzzzzzzzzrrrrrrrrrrrrrrrrrffffffqqqqqqqqqqqqqqq bbbbbbbbbbbbbbbbbbbbbbpppppppppppppppppppppppppppppppppyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyy';\r\nVexp=161166448;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt tttttttttttttttttttttttttttttt qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq vvvvvvvvvvvvvvvvvvv lllll vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv jjjjjjjjjjjjjhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh vv tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt tttttttttttttttttttttttttttttttttttttttttttttttttt tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt tttttttttttttttttttttttttttttttttttttttttt zzzzzrrrraaaaaasssssssseeeeeegggggggiiiooooooooooooobbbbbbbbkkkkkkkkkkyyyyyyyyyyywwwwwwww tttttttttttttttttttttttttttttttttttttttttttttttt vvvvvvvvvvvvvvvmmmmmmmmmmmmmmmmmmmmmmmmmmmmm tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt lllllllllllllllllllllllllllllllllllllllllllllllllllllll nnnnnnnnnnnnnnnnnnnndddddddddddddddddddddddddddxxxxxxxxxxxxxxxx tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt ttttttttttttttttttttttttttttttttttttttttttttt ffffffffffffffffffffffffffffffffffjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhllllllllllllllllllllllllllllllllllllllllll tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt pppppppppppppppppppppppuuuuuuuuuuuuuuuuuuuuuuuuuuucccccccccccccccccc mmmmmmmmmmmmmmmmmmmmmm mmmmfffffffff jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj tttttttttttttttttttt';\r\nVexp=459335393;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='ppppppp aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz ttttttttttttttttttttttttttttaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ddddddddddddddddpppppppppppppppp hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh xxxxxxxxxxxxxxxxxxxxxxxxxxxx hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh aaaaaaaaaaaavvvvvvvvvvvvvvvv yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyykkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv hhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh pppppppppppppppppppppppppppjjjjjjjjjjjjjjjjjjjjjjjjjjjjj hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhh pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhh aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh nnnnnnnooooooooouuuuuuuuuuurrrrrrrrrrrwwwwwwww hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh wwwwwwwwwwwwwwwwwwwwwwwwwww hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh sssssssssssssssssssssss hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh ttttttttttttttt zzzzzzzzzzzzzzzzzzzzz ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ccccccccccccccccceeeeeeeeeeeeeeeeeeemmmmmmmmmmmmmmmmm ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh fffffffffffqqqqqqqqqqqq yyy vvvvvvvvvvvvvvvvvvv xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz aaaaaaaaaaaaaaaaaaaaaaaaaaa jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj zzzzzzzzzzzzzzzzzz zzzzzzzzzzzzzbbbbbbbbbb dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd hhhhhhhhhhhhhhhhhhhhhhh ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd kkkkkkkkkkkkkkkkkkkkkkkkkkkkkzzzzzzzzzzzzzzzzzzzzzzzzzzzzz vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss hhhhhhhh iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii ss hhhhhhhhhhhhhhhhhhh bbbbbbbbbbbbbbbsssssssssssss hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh dddddddddddddddddddddddddddddddddddddddd hhhhhhhhhhhhh tttttttttttttttttttttttttttttttttttttttttttttttt bbbbbbbb hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh ttttttttttttttttttttttt xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxtttttttttttttttttttttttttttttttt hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhh zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz hhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh';\r\nVexp=893810165;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhsssssssssssssssssssssssssss gggggggggggggggggggggggggggggggggggggg wwwwwwwwwwwwwwwwwwwwwwwwwww nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn ggggggggggggggggggggggggggggggggggggg qqqqqqqqqqqqqqqqqqwwwwwwwwwwwwwwwwwwwww iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii lllllllllllllllllllllllll ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj lllllllllllllllllyyyyyyyyyyyyyyyy qqqqqqqqqq wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww pppp bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjjjjjjjjjjhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh mmm sssssssssssssssssssssssssllllllllllllllllllll mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm iiiiiiiiigggggg mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii gggggggggqqqqqqqqqqqqqqqqqq qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq fffffffvvvvccccccccccccoooooddddddddd uuuuuuuuuuuuuuuuaaaaaaaaaaaaaaaaaarrrrrrrrrrrrrrrrrrrzzzzzzzzzzzzzzztttttttttttteeeeeeeeeeeeeeeeee ppppppppppppppppppppp hhhhhh ssss ppppppppppppppppppppppppppppppppxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx wwwwwwwwwwwwwwwwwmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkpppppppppppppppppppppppppppppppppppppppppppppppppp xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx yyyyyyyyy xxxxxxxxxxxxxxxxxxxxjjjjjjjjjjjjjjjjjjj lllllllllllllllllllll mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg wwwwww hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk';\r\nVexp=588556762;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii oooooooooooooooooooooooooooooooaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbb uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu oooooooooooooooooooooooooooooooooooooooooooo llllllllllllllllllllllllllllllllllllll bbbbbbbbb uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx aaaaaaaaaaaaaaaaa xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc oooooooooooooooooo cccccccccccccccccccccccccccccccccccccccccc llllllllllllllllllllllllllljjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn iiiiiiiiiiiiiiiiiii oooooooooooooooooooooooooooooooooooooooo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj iiiiiiiiiiiiii jjjjjjjjjjjjjjjjjjjjjjjwwwwwwwwwwwwwwwwwwwwww ooooooooooooooooooooooooooooooooooooooooooooooo bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbboooooooooooooooooooooooooooooooooooooooooooooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa oooooooooooooooooooooooooooooooooooooooooooo iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii ccccccccccccccccccccccccccccccccccccccccc bbbbbbbbbbbbbbbbbbbbbbbbbbb aaaaaaaaaaaaaaaa uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ooooooooooooooooooooo uuuu cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx kkkkkkkkkkkkk uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkllllllllllllllllllllllllllllllllllllllllllllll aaaaaaiiiiiiiiiiiiii uuuuuuuuuuuuu kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn ccccccccccccccccccccccccccccccccccccccccccccccccckkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk ooooooo jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo iiiiiiii eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb jjjjj kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb jjjjjjjjjjjjjjjjjjjj nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn xxxxxx llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll iiiiiiiiiiiiiiiiiiiiiiiiii nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxeeeeeeeeeeeeeeeeeeee wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww llllllllllllllllllllllllllllllllllllllllllllllllllllllll eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa uuuuuuuuuuuuuuuuuuu oooooooooooooooooooooooooooooooo jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee oooooooo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ii iiiiiiiiiiiiiiuuuuuuuuuuuuuuuuuu oooooooooooooooooooooooooooooooo xxxxxxxxxxxxxxxxxxxxxx lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww wwwwwwwwwww aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa llllllllllllllllllllllll eeeeeeeeeeeeeeeeeee lllllllllllllllllllllllllllllllllllllllllllllllll ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc';\r\nVexp=125298902;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='hhhhhhhhhvvvvv kkhh ppmmmmmmmmm zzxxx sssccccccc fffffffqq yyyyyyyeeeeee xxxxxxxxi eeeeeeeeaaaaaaaa jjjppppppp ddddf cccccrrrrrrrr';\r\nVexp=720;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr tttttttttttttttttttttttttttttttttttttttttttttttttttttttttt ppppppppppppppppppppppppppppppppppppppppppppyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz nnnnnnnnnnnnnnnnnnnnnnn qqqqqqqqqqqq llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll yyyyyyyyyyyyyyyyyyyyy ttttttttttttttttttttttttttttttttttttttttttttt zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzppppppppppppppppppppppppppppppppppppppppppp ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy ffffffffffff iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii ddddddddddddddddddddddddssssssssssssssssssssssssssssssss qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu zzzzzzzzzzzzzzzzzzz rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr cccccccccccccccccccccccccccccccccccccccccccc rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr ggggggggggggggggggggggggggggggggggggggggggggggggggggggg ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg aaaaaaaaaaaaaaaaaaaaa pppppppppppppppppppppppppppp yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy ccccccccccccccccccccccccc cccccccccccc aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa iiiiiiiiiiiiiiiiiiivvvvvvvvvvvvvvvvvvvvdddddddddddddddddd cccccccccccccccccaaaaaaaaaaaaaaaaaaaaa wwwwwwwwwwwwwwwwwwwwwwwooooooooooooooooooooo yyyyy llllllllllllllbbbbbbbbbbbbbbbbbbbbbuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy fffffffffffffffffffffffffffffffffzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr tttttttttttttttttttttttttttttttttttttttttttffffffffffffffffffffffffffffffffffffffff sssssssssssssssssssssssssss xxxxxxxxxxxxxxxxxxxxxx yyyyyqqqqqqq ffffffffff ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrttttttttttttttttttttttttttttttttttttttttttt xxxxxxxxxxxxxxxxxxxxxxxxxxx gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq ooooooooooooooooooooooooooooooooooooo rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr xxxxxxxxxxxxxxxxxxxxxxxxxxxxxeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii qqqqqqqqqqqqqqqqqqqqqqqqnnnnnnnnnnnnnnnnnnnn jjjjjjj ssssssssssssssssssssssssssssssssssssssssssswwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy jjjjjjjjjjjjjjjjjjjjjjjjjjjjjcccccccccccccccccccccccccccccccccc tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ggggggggggggggggggggggggggllllllllllllllll aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaarrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc qqqqqqqqqqqqqqqqqqqqqqqqq rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww ssssssss cccccccccccccccccccccccccccccccccc jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj tttttttttttttt iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx jjjjjjjjjjjjjjjjjjjjjj';\r\nVexp=45590719;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh mmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmm mmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll xxxxxxvvvvvvvvvvvvvoooooojjjjjjjjaaaaaaaffffffffppppppppyyyyyykkkkkkkkkqqqqqqqqqqrrrrrr mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm wwwwwwwnnnneeeeeeesssssuuuuuuuuuudddddddddiiiiiiii mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmm mmmmmmmmmmmmmmm ggggggggggggggggggggggggggggggcccccccccccccccccccccccccccccc mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt';\r\nVexp=757993753;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg gggggggggggggggggggggggggggggggg iihhhhhhaaaaaaaaallmmmmmeeedddddbbbbbbppssssssoooovvvvvvffffftttttttttqqqqqkkkkkknnnnn uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu rrrrrrrrrrrrrrrrrrrrrrrrrr gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg ggggggggggggggggggggggggggggggggggggg gggggggggggggggggggggggggggggggggggggggggggggggggg ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg ggggggggggggggggg rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyxxxxxxxxxxxxxxxxxxxxxxxxxxxxwwwwwwwwwwwwwwwwwwwwwwwwww';\r\nVexp=16857327;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='ccccccccccccccccccccccccccccccccccccccc zzzzzzzzzzzzzzzzzzzzzzzzzzzzzrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr llllllllllllllllllllllllllllllllllllllllllllllllllllll lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll tttttttttttaaaaaaaaakkkkkk qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq ccccccccccc uuuuuuuuuujjjjjjjssssssssssssss llll llllllllllllllllllllllllll cccccccccc lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc yyyyyyyyypppppppffffffffffxxxxxxxxxxxxxxiiiiiiiiiiiiiii hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh lllllllllllllllllllllllllllllllllllllll lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll hhhhhhhhhhhhhhhhhhhhh ccccccccccc mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz cccccccccccccccccccccccccccccccccccccccc hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn kkkggggggggeeeeeeeeeeeeeeeeeoooddddddddddwwwwwmmmmmmmmm bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz cccccccccccccccccc llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc llllllllllllllllllllllllllllllllllllllllllllll cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb';\r\nVexp=539156306;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa sssssssssssssbbbbbbbbbbbbbbbb nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn sssssssssssssssssssssss bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb nnnnnnnnnnnnnnnnnnnnnnnnnnnnnn bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb eeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ssssssssssssssssssssssssssssssssssss nnnnnnnnnnnnn ssssssssssssssssssssssssssssssssssssssssssssss eeeeeeeeeeeeeeeeeeeeeeeeeeeeee bbbbbb sssssssssssssss nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn aaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa nnnnnnnnnnnnnnnn sssssss bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa sssssssssssssssssssssssssssssssssssss bbbbbbbbbbbbbbbbbbbbbbbb nnnnnnnnnnnnneeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn ssssssssssssssssssssssssssssssssssss nnnn bbbbbbbbbbbbbbbbbbbnnnnnnnnnnnnnnnnn ssssssssssssssssssssssssssssssssssssssssss nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnn ssssssssssssss bbbb ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss sssss sssss sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn sssssssssssssssssssssssssssssssss nnnnn aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaa';\r\nVexp=392523621;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='ccccccccccccccccccccccccccccccccc llllllllllllllllllllllllllllllllllllll cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc llllllll llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll wwwwwwwwzzzzzzzzzzzzzeeeeeeeeeeuuuuuuuuvvvvvvvvvvvvvvrrrrrrrrrrtttttttttttttt llllllllllllllllllllllllllllllllllllllllllllllllllllllllll ttttttthhhhhmmmmmmmmmqqqqqqqqqqqqqq ccccccccccccccccccccccccccccccccccccccccccccc cccccccccccccccccccc lllllllllllllllllllllllllllllllll lllllllllllllllllllllllllllllllllllllllllllllllllllllllll llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll bbbbbbbppyyyyyyiiisssssssnnnff ccccccccccccc llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll llllllllllllllllllllllllllll xxxxxjjjjjjddddaaaaaakkkkkkkkk cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc llllllllllllllllllllllllllllllllllllllllllllllllllllll llllllllllllll lllllllllllllllll lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc cccccccccccccccccccccccccccccccccccccccccccccccccccccccc cccccccccccccccccccccccccccccccccccccclllllllllllllllllllllllllllllllllllll ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc cccccccccccccccccccccccccccccccccccccccccccccc ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc ccccccccccccccccccccccccccccccccccccccccc lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll cccccc tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc cccccccccccccccccccccccccccccccccccccccccccc';\r\nVexp=981953933;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='wwwwwwwwwwhhhhhhhhhh zzzzzzzzzzzzzzzzzzzzvvvvvvvvvvvvvvvaaaaaaaaaaaaaaaaaaaaaaiiiiiiiiiiiiiiiiiii kkkkkkkkkkkkkkkkkkkkk uuuuuuuuuuuuu jjjjjjjjjjjjjjjjjjjjjjjjjjjjjbbbbbbbbbbbbbbbb kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu uuuuuuuuuuuuuuuuuuuuuuuuuuuujjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj kkkkkkkkkkkkkkkkkk uuuuuuuuuuuuuuuuuu mmmmmmmmmmmmmmmmmmmmmmmpppppppppppppppp kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee jjjjjjjjjjjjjj eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee bbbbbbbbbbbbbbbbbbbbbbbbbbbqqqqqqqqqqqqqqqqqqqq jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk uuuuuuuuuuuuuuuuuu qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq lllllnnnnnnnnnnnnnnnnn nnnnn wwwwwwwwwwwwwwwww nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhheeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq wwwwwwwwwwwwwwwwwwww kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk xxxxxxxxxrrrrrrrrrgggggggggggggffffffffftttttttccccccccccccccccoooooooddddyyyyy eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww jjj uu bbbbbbbbbbbbbbbbbbb qqqqqqqqqqqqqqqqqqqqqqq qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeelllllllllllllllllllllllllllllllllllllllllllll bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww';\r\nVexp=310957976;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='aabbbbbcccddeeeeeeeefffgggggghhhhiiiiiiiijjkkkkklllmmmmmmmnnnooooppppppqqrrsssttuuuuuuuvvvvwxxyyyyya';\r\nVexp=0;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='bbbbbbbbbbbbbbbbbbbbbbbbbbb lllllllllllllllllllllllllllllllllllllllllll hhhhhhhhhhhhhhhhhhh kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt aaaa hhhhhhhhhhhhhhhhhh iiiiiiiiiiiiiiiiiiiiiiiiiiyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh bbbbbbbbbbbbbbbbbbbbbbb llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll nnnnnnnnnnnnnnnnnnnnnnnnnnn hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu hhhh jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv hhhhhhhhhhhhhhh bbbbbbbbbbbbbbbbbbbb bbbbbbbbbbbbbbbbbbbbbbb bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb qqqqqqsssssspppppppppmmmmmmfffffffff vvvvvvvooooooooooowwwwwwwwwwwccccccccrrrrrrrrrrddddddddddddddddddd xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ttttttttttttttttttttttttttttttttttttttttttttttttttttt uuuuuuuuuuuuuuuuuuuuuuuuu hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh nnnnnnnn hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhh uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh llllaa gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh nnnnnneeeeeeeeettt bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb tttttttttttttttttt zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz hhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb uuuuuuuuuuuuuuuuuuuuuuu hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh bbbbbbbbbbbbbbbbbbbbb nnnnnnnnnnnnnnnnnnnnnnnnnnn tttttttttttttttttttttttttttttttttttt uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzlllllllllllllllllllllllllllllllllllllllllll hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh kkkkkkkkkkkkkkkkkkk bbbbbbbbbbbbbbbbbbbbbbb uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh uuuuuuuuuuuuuuu aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaannnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn gggggggggggggggggggggggggggggggggggzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb';\r\nVexp=236753019;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt';\r\nVexp=1;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq dddddddlllllllllllllll xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm ssssssssssssssssssssssssssssssssttttttttttttttttttttttttttttttttttttttttttt hhhhhhhhhhhhhhhhhhhhhkkkkkkkkkkkkkkkkkkkkk aaaaaaaaaaaaaaaaaaaaaaaaaaaccccccccccccccccccccc gggggggggggggggggggggggggggggggggggggddddddddddddddddddddddddddddddddddddddd ttttttttttttttttttttttttttttiiiiiiiiiiiiiiiii llllllllllllllllllhhhhhhhhhhhhhhhhhhhhhh rrrrrrrrrrrrrrrrrzzzzzzzzzzzzz kkkkkkkwwwwwwwwwwwwwwwwwwwnnnnnnnnnnnnnyyyyyyyyyyyyy iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ppppppppppppppppppppppppppppppppppppppppppxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx qqqqqqqqqqqqqqqqqqqqbbbbbbbbbbbbbbbbbbbbbbssssssssssssssssssssssssssssssssss sssssssssssssss oooo ppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp mmmmmmmmmmmm ffffffeegggggggg iiiiiiiiiiiivvvvvvvvvvvvv yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvfffffffffffffffffffffffffffffffffffffffffffffff xxxxxxxxxxxxxxxxxxxxxxxxx oooooorr ffffffffffffffffff pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp xxxxxxxxxx ooooooooooooooooooooooo mmmmmmmmmmmmmmmmmmmmmmoooooooooooooooooooooooooooooo';\r\nVexp=48;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeeeeeee dduuknnnbbyyysssssqqmmfrrrrrraaaacczzziiiiigggggxxxllllp eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj vvvvvvvvvvvvvvvvvvvvvvhhhhhhhhhhhhhhhhhhhhhhhttttttttttttttttttttttttttt eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww eeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee';\r\nVexp=901255609;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ccccccccccccccccccccccc yyynnttooppphhhiiiwwllllggg vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv cccccccccccccccccccccccccccccccccccccccccccccc kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss kkkkmmmmmmm uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu fffffffffffff ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa sssssssssssssssssssssssssssssssssssssssssssssssssssss kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk sssssssssssss ccccccccccccccccccccccccccccccccccccccccccccccccccccccc jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjccccccccccccccccccccccccccccccccccccccccccc xxxxxxxxxxxxxxxddddddddddddddrrrrrrrrrrrrrrrrrrrrrrrqqqqqqqqqeeeeeeeeeeeee kkkkkkkkkkkkkkkkkkkkkkkkkkkkk ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss ssssssssssssssssssssssssssssssssssssssssssssssssssssssss mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk zzzzzzzzzzzzzzzzzz kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmzzzzzzzzzzzzzzzzzzzzzzzzzz';\r\nVexp=654434779;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='rrrr rrrrrrrrrrrrrrrrrrrrrrr pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp tttttttttttttttttttttttttttttttt lllllllllllllllllllllllllllllllllllllllllllllllllllllllll ttttttttttttttttttttttttttttttttttttttttttttttttttttt vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv gggggggggggggghhhhhhhhhhhhhhhhhxxxxxxxxxxxxxxxkkkkkkkkkkkkkkkkkccccccccccccc jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj lllllllllllllllllllllllllllllll vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii tttttttttttttttttttttttttttttttttttttttttttttttttt rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr ttttttttttttt qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii tttttttttttttttttttttt ttttttttttttttttttttttttttttttttttttttttttttttttttttttt rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr rrrrr jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll ppppppppppppppppppppppppppppp jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj wwwwwwwwwwwwwwwwwwwwwwwwwwwwwww tttttttttttttttttttttttttttttttttttt ooooooooooooooooooooooooooooooooonnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii rrrrr pppppppppppppp iiiiiiiiiiiiiiiiiiiiiii lllllllllllllll tttttttttttttttttttttttttttttttttttttttttt tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr lllllllllllllllllllllllllllll vvw llllllllllllllllllllllllllllllllllll pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr llllllllllllllllllllllllllllllllllllllllllllllllliiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii dddddddddddddddbbbbbbbbbbbbbbbbeeeeeeeeeeeeeeeeeeeyyyyyyyyyyyysssssssssssssssssssss mmmmmmmmmmmmmmmmmmmmmmmaaaaaaaaaaaaaaaaaaa ppppp vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr jjjjjjjjjjjjjjjjjjjjjjjjjjjj rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt nnnnnnnnnnnnnnnnuuuuuuuuuuuuuuuzzzzzzzzzzzzzzzzzzzzzz gggggggggggg tttttttttttttttttttttttttttttttttttttttttttttt rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv wwwwwwwwwwpppppp iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww jjjjjjjjjjj wwwwwwwwwwwwww wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww lllllllllllllllllllllllllllllllllllllllllllllllllllllllllll cccccccccccccccccccfffffffffffffffff llllllllllllllllllllllllllllllllllllllll tttttttttttttt pppppppppppppppppppppppppppppppppppppppp wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt jjjjjjjjjjjj ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo tttttttttttttttttttttttttttt zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzgggggggggggggggggggggggggggggggggggggggg rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii ttttttttttttttttttttttttttttttttttttttttttttttt llllllllllllllllllllllllllllllllllllllllllllllllll vvvvvvvvvv';\r\nVexp=977338612;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ccccccccccccccccccccccccccccccccccccccccccccccc ffffffffffffffffffffffffffffffffffffffffffffffffffpppppppppppppppppppppppppppppppppppppppppppppp cccccccccccccccccccccccjjjjjjjjjjj ppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp ccc pppppppppppppppppppppppppppppppppppsssssssssssssssssssssssssssssssssssssss ppppppppppppppppppppppppppp eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ssssssssssss iiiiiccccccccc jjjjjjffffffffffff ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ppppppppppppppppppppppppppppppppppppppppppppp ssssssssssssssssssssssssssssseeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp eeeeeeeeeeeemmmmmmmmm iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii';\r\nVexp=864;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj aaaaa ooooooooooooooooooo mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm nnnn sssssssssssssssssssssssssssssssssssssssssssssuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn gggggggggggggggggggggggggggggggggggggggggggggggggggggg aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj aaaaaaaaaaaaa jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee mmmmmmmmmmmmmmmmmmmmmm eeeeeeewwww nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo aaaaaaaaaaaaaaa wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz nnnnnnnnnnnnnnnnn lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv ppppppppppppppppppppppppppppppppppppppppppppppgggggggggggggggggggggggggggggggggggggggggggggggggggggg ttttttttttttttttttttttttttttttttttttttttttttt xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd fffffffffffffffffffffffffffffffffffffff cceee ooooooooooooooooo jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm ffffffffffffffffffffffffffffffffffffffffffffttttttttttttttttttttttttttttttttttttttttttttt xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp lllllllllllllllllllllllllllllllllllllllllllll fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn ppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp ttttttttttttttttttttsssssssssssssssssssssssssssssssssssssssss wwwwwwwwwwwwwwhhhhhhhhhhhhhhhhllllllll aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii ggggggggggggggggggggggggggggggggggggggggggggggggg aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ooooooooooooooooooooovvvvvvvvvvvvvvvvvvv aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa iiiiiiiiiiiiiiiiiiiiiiippppppppp cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv yyyyyyyyyyyyyyyyyyyyyyyyffffffffffffffffffffffffffffffffffffffffffffff aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa fffffffff mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm ggggggcccccccc mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm aaaaaaaaaaaaaaaaaaaaaaaaaaa kkkkkkkkkkkkkkkkkkkkkkkrrrrrrrrrrrrrrrrrrrrrrrrrr uuuuuuuuuuuuuiiiiiiiiii nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy mmmmmmmmmmmmmmm aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx iiiiiiiii';\r\nVexp=702191236;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='oooooooooooooooooooooooooooooooooooaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee bbbbbbbbbbblllllllllllllllllzzzzzzzzzzzvvvvvvvvvvvvvvvvqqqqqqqqqqqkkkkkkkkkkkkkhhhhhhhhhhhhhhh eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee nnnnnnnnnnnnnnnnnnnnnnnnn eeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee iiiiiiiiiiiiiiiiiiiiiiiiii iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnn eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee fffffffffffffffffffffffffffuuuuuuuuuuuuuuuuuuuuuuuu nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn rrrrrrrrrrrrrtttttttttttttmmmmmmmmmmmmccccccccyyyyyyyywwwww nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii pppppppppppppppsssssssssssssssssssjjjjjjjjjjjjjjjjjddddddddddddddddxxxxxxxxxxxxxxxx nnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee';\r\nVexp=880614102;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\ns='gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww vvvvvvvvvvvvvvvvvvvvvvvvvv wwwwwwwwwwwwwwwwwwww rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww wwwwwwwwwwwwwgggggg nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww ggggggggggggggggggg vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn gggggggggggggg nnnnnnnnnnnnnnnnnnnnnnnnnn vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww zzzzzzzzzzzzzzzdddddddddddddddddddddyyyyyyyyyyyyyy jjjttttxxxxhhfffllllllqqqqqiiiiiimmmmmmmmuueeeeccccsssooookkkkppppppaabbbbbb vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv nnnnnnnnnnnnnnnnnnnnnnnnnn vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg vvvvvvvvvvvvvvvvvvvvvvvnnnnnnnnnnnnnnnnnn wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww';\r\nVexp=101045724;\r\nval=train(s);\r\nassert(isequal(Vexp,val))\r\n%%\r\n%s='jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk eeeeeeeeeeeeeeeeeeexxxxxxxxxxxxxxxxxxxxxxxx bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb yyyyyyyyyyyyyyyykkkkkkkkkk mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww oooo ggggggggggggggggyyyyyyyyyyyyyyy iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiihhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb iiiiiiii ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc hhhhhhhhhhhhhhggggggg hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh wwwwwaaaaaaa rrrrrrrrrrrrrrrr hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh ooojjjjjjj rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccccc kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk ddddddddddddddddddddddddddddddddddddddddd iiiiiiiiiiiiiiiiiiiiiiiiiiiii","published":true,"deleted":false,"likes_count":1,"comments_count":2,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":2,"test_suite_updated_at":"2020-10-01T17:08:50.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2014-05-15T21:15:21.000Z","updated_at":"2020-10-01T17:08:50.000Z","published_at":"2014-05-15T21:59:11.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis Challenge is derived from\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://code.google.com/codejam/contest/3004486/dashboard#s=p1\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eGJam 2014 Rd 1c: Reordering Train Cars (Large)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eDetermine number of sequences for set of strings under the constraint that all same characters must be contiguous. The large case could have 26! or more permutations.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eInput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e s, string of N space separated string segments of letters [a..z]. 1\u0026lt;=N\u0026lt;=100. Total letters \u0026lt;=100.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e val, number of possible sequences, modulo 1,000,000,007\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eExample:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Small Train Case examples\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ab bbbc cd Val=1 as only abbbbccd can be created\\naa aa bc c Val=4 aa gives 2 positions, aa'aa''bcc,aa''aa'bcc, bcccaa'aa'',bcccaa''aa'\\nabc bcd  Val=0 as c is internal and thus can not connect to c of abc]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eTheory:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/2324-gjam-2014-rd-1c-train-cars\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eTrain Small Spoilers\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eLarge Case specific info. See\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/1833-usage-of-java-math-add-multiply-pow\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUsage of java math\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e for unlimited precision. Note intValue gives more precision than floatValue. No java factorial exists so a function, non-recursive, is suggested. The small solution can be converted via java BigInteger factorial, mod, multiply, and intValue to solve the large case.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAdditional GJam solutions can be found at\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://go-hero.net/jam\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eExample GJam Matlab solutions\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. Select Find Solutions, change Language to Matlab. The Test Suite, at the bottom, contains a full GJam Small Matlab solution. No Valid Matlab solutions were submitted during the contest.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":42779,"title":"GJam March 2016 IOW: Polynesiaglot Large","description":"This Challenge is derived from \u003chttp://code.google.com/codejam/contest/8274486/dashboard#s=p2 GJam March 2016 Annual I/O for Polynesiaglot\u003e. This is the Large input set. The max Qraw is 100^500, (V+C)^L.\r\n\r\nThe GJam story goes that words are such that consonants are always followed by a vowel. Determine the number of possible words of length L using C consonants and V vowels. The final Q is to be modulo of the prime 1E9+7.\r\n\r\n*Input:* [C V L] , C[1,50], V[1,50], 1\u003c=L\u003c=500\r\n\r\n*Output:* [Q] max Qraw is 100^500; Q=mod(Qraw,1E9+7)\r\n\r\n*Examples:* [C V L] [Q]\r\n\r\n  [1 1 4] [5] {aaaa,aaba,abaa,baaa,baba}  invalid are {bbaa, aaab} \r\n  [1 2 2] [6] {aa,ae,ba,be,ee,ea} invalid are {ab,eb,bb}\r\n \r\n\r\n*\u003chttp://code.google.com/codejam Google Code Jam 2016 Open Qualifier: April 8, 2016\u003e*\r\n\r\n*Theory:* This is a huge value problem, on the order of (C+V)^L, thus brute force will not work. This is also a probability tree type problem. Tree calculations can be reduced to a linear in L evaluation. Inspection shows Q(1)=V, Q(2)=V^2, L=3 Q(3)=V^3+V*C*V+C*V^2 = V*Q(L-1)+V*C*Q(L-2)+C*Q(L-1).  There are no Cs at the Q1 level since can not end in a C. Qnext=f(Q(-1),Q(-2)). Qfinal=Q+C*Q(L-1)\r\n\r\n  Q3    V          C\r\n  Q2  V   C       V\r\n  Q1 V   V       V\r\n\r\nOne method to succeed in this problem is to use the java capability of Matlab.\r\n\u003chttp://www.mathworks.com/matlabcentral/cody/problems/1833-usage-of-java-math-add-multiply-pow Cody Java Challenge\u003e. The primary reference sites are \u003chttp://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Number.html Java Math\u003e, \u003chttp://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigDecimal.html Java BigDecimal\u003e, and \u003chttp://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigInteger.html Java BigInteger\u003e. The Java solution by the winner Stacy is included at the bottom of the test suite.\r\n\r\n","description_html":"\u003cp\u003eThis Challenge is derived from \u003ca href = \"http://code.google.com/codejam/contest/8274486/dashboard#s=p2\"\u003eGJam March 2016 Annual I/O for Polynesiaglot\u003c/a\u003e. This is the Large input set. The max Qraw is 100^500, (V+C)^L.\u003c/p\u003e\u003cp\u003eThe GJam story goes that words are such that consonants are always followed by a vowel. Determine the number of possible words of length L using C consonants and V vowels. The final Q is to be modulo of the prime 1E9+7.\u003c/p\u003e\u003cp\u003e\u003cb\u003eInput:\u003c/b\u003e [C V L] , C[1,50], V[1,50], 1\u0026lt;=L\u0026lt;=500\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput:\u003c/b\u003e [Q] max Qraw is 100^500; Q=mod(Qraw,1E9+7)\u003c/p\u003e\u003cp\u003e\u003cb\u003eExamples:\u003c/b\u003e [C V L] [Q]\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e[1 1 4] [5] {aaaa,aaba,abaa,baaa,baba}  invalid are {bbaa, aaab} \r\n[1 2 2] [6] {aa,ae,ba,be,ee,ea} invalid are {ab,eb,bb}\r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003e\u003ca href = \"http://code.google.com/codejam\"\u003eGoogle Code Jam 2016 Open Qualifier: April 8, 2016\u003c/a\u003e\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003eTheory:\u003c/b\u003e This is a huge value problem, on the order of (C+V)^L, thus brute force will not work. This is also a probability tree type problem. Tree calculations can be reduced to a linear in L evaluation. Inspection shows Q(1)=V, Q(2)=V^2, L=3 Q(3)=V^3+V*C*V+C*V^2 = V*Q(L-1)+V*C*Q(L-2)+C*Q(L-1).  There are no Cs at the Q1 level since can not end in a C. Qnext=f(Q(-1),Q(-2)). Qfinal=Q+C*Q(L-1)\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eQ3    V          C\r\nQ2  V   C       V\r\nQ1 V   V       V\r\n\u003c/pre\u003e\u003cp\u003eOne method to succeed in this problem is to use the java capability of Matlab. \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/1833-usage-of-java-math-add-multiply-pow\"\u003eCody Java Challenge\u003c/a\u003e. The primary reference sites are \u003ca href = \"http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Number.html\"\u003eJava Math\u003c/a\u003e, \u003ca href = \"http://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigDecimal.html\"\u003eJava BigDecimal\u003c/a\u003e, and \u003ca href = \"http://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigInteger.html\"\u003eJava BigInteger\u003c/a\u003e. The Java solution by the winner Stacy is included at the bottom of the test suite.\u003c/p\u003e","function_template":"function [T]=Polyglot(m)\r\n% T total words of length L using C consonants and V vowels\r\n% \r\n% import java.math.*\r\n% xBI=BigInteger(12)\r\n% zBI=xBI.add(yBI);\r\n% zBI=xBI.multiply(yBI);\r\n% mBI=xBI.mod(BigInteger('1000000007'));\r\n% z=str2num(zBI); % Convert JavaBigInteger to numeric\r\n \r\n\r\n import java.math.*\r\n\r\n C=BigInteger(m(1));  % BigInteger\r\n V=BigInteger(m(2));  % BigInteger\r\n L=m(3); % \r\n\r\n\r\n% Values above 255 get mod applied so use string input to BigInteger \r\n TJ=TJ.mod(BigInteger('1000000007'));\r\n% Convert BigInteger type to a numeric \r\n T=str2num(TJ);\r\n \r\n \r\nend","test_suite":"%%\r\ntic\r\n% T 0.7\r\nm=[1 1 4 ];\r\nv=Polyglot(m);\r\nvexp=[5 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 0.8\r\nm=[1 2 2 ];\r\nv=Polyglot(m);\r\nvexp=[6 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[43 47 500 ];\r\nv=Polyglot(m);\r\nvexp=[671294715 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[45 44 500 ];\r\nv=Polyglot(m);\r\nvexp=[474858966 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 104.4\r\nm=[1 1 500 ];\r\nv=Polyglot(m);\r\nvexp=[523068127 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 0.3\r\nm=[2 2 1 ];\r\nv=Polyglot(m);\r\nvexp=[2 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[48 41 500 ];\r\nv=Polyglot(m);\r\nvexp=[356064865 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 1.6\r\nm=[50 41 1 ];\r\nv=Polyglot(m);\r\nvexp=[41 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[41 40 500 ];\r\nv=Polyglot(m);\r\nvexp=[396751820 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[40 45 500 ];\r\nv=Polyglot(m);\r\nvexp=[938256882 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[46 44 500 ];\r\nv=Polyglot(m);\r\nvexp=[883121986 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[50 40 500 ];\r\nv=Polyglot(m);\r\nvexp=[684068183 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 1.3\r\nm=[4 3 2 ];\r\nv=Polyglot(m);\r\nvexp=[21 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[48 46 500 ];\r\nv=Polyglot(m);\r\nvexp=[15068072 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[46 47 500 ];\r\nv=Polyglot(m);\r\nvexp=[483582780 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[48 43 500 ];\r\nv=Polyglot(m);\r\nvexp=[357963597 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[40 50 500 ];\r\nv=Polyglot(m);\r\nvexp=[722287557 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[47 40 497 ];\r\nv=Polyglot(m);\r\nvexp=[142264969 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[42 45 500 ];\r\nv=Polyglot(m);\r\nvexp=[300845428 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[42 50 500 ];\r\nv=Polyglot(m);\r\nvexp=[626241204 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[50 50 499 ];\r\nv=Polyglot(m);\r\nvexp=[244005114 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 3.1\r\nm=[40 4 3 ];\r\nv=Polyglot(m);\r\nvexp=[1344 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 1.6\r\nm=[43 42 1 ];\r\nv=Polyglot(m);\r\nvexp=[42 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[44 49 500 ];\r\nv=Polyglot(m);\r\nvexp=[518096485 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[45 46 500 ];\r\nv=Polyglot(m);\r\nvexp=[223782662 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[49 40 500 ];\r\nv=Polyglot(m);\r\nvexp=[678295851 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 2.2\r\nm=[50 3 2 ];\r\nv=Polyglot(m);\r\nvexp=[159 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 2.3\r\nm=[48 4 2 ];\r\nv=Polyglot(m);\r\nvexp=[208 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[5 41 498 ];\r\nv=Polyglot(m);\r\nvexp=[583339519 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 3.3\r\nm=[3 43 2 ];\r\nv=Polyglot(m);\r\nvexp=[1978 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[41 49 500 ];\r\nv=Polyglot(m);\r\nvexp=[707985113 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[46 43 500 ];\r\nv=Polyglot(m);\r\nvexp=[254325944 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 0.0\r\nm=[2 1 1 ];\r\nv=Polyglot(m);\r\nvexp=[1 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[5 5 499 ];\r\nv=Polyglot(m);\r\nvexp=[167403707 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[48 40 500 ];\r\nv=Polyglot(m);\r\nvexp=[687213242 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 1.7\r\nm=[43 46 1 ];\r\nv=Polyglot(m);\r\nvexp=[46 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[43 4 498 ];\r\nv=Polyglot(m);\r\nvexp=[127737869 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[44 47 498 ];\r\nv=Polyglot(m);\r\nvexp=[809685798 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[41 50 500 ];\r\nv=Polyglot(m);\r\nvexp=[701760607 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[40 48 500 ];\r\nv=Polyglot(m);\r\nvexp=[783408764 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[3 40 499 ];\r\nv=Polyglot(m);\r\nvexp=[158384704 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[50 48 500 ];\r\nv=Polyglot(m);\r\nvexp=[198880135 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[49 44 497 ];\r\nv=Polyglot(m);\r\nvexp=[539871481 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[44 42 500 ];\r\nv=Polyglot(m);\r\nvexp=[227201453 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[41 47 500 ];\r\nv=Polyglot(m);\r\nvexp=[212311056 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 254.9\r\nm=[2 2 500 ];\r\nv=Polyglot(m);\r\nvexp=[667073398 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[45 50 500 ];\r\nv=Polyglot(m);\r\nvexp=[556413734 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 5.3\r\nm=[46 40 3 ];\r\nv=Polyglot(m);\r\nvexp=[211200 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[45 4 499 ];\r\nv=Polyglot(m);\r\nvexp=[334760532 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[40 43 500 ];\r\nv=Polyglot(m);\r\nvexp=[328797447 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[50 45 500 ];\r\nv=Polyglot(m);\r\nvexp=[225964115 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[49 42 500 ];\r\nv=Polyglot(m);\r\nvexp=[690707538 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[40 46 500 ];\r\nv=Polyglot(m);\r\nvexp=[195330871 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 1.6\r\nm=[5 4 2 ];\r\nv=Polyglot(m);\r\nvexp=[36 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[42 49 500 ];\r\nv=Polyglot(m);\r\nvexp=[188049811 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 0.0\r\nm=[1 1 1 ];\r\nv=Polyglot(m);\r\nvexp=[1 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 218.1\r\nm=[1 2 500 ];\r\nv=Polyglot(m);\r\nvexp=[696656237 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[42 40 500 ];\r\nv=Polyglot(m);\r\nvexp=[922192442 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[49 45 500 ];\r\nv=Polyglot(m);\r\nvexp=[763469125 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[50 42 500 ];\r\nv=Polyglot(m);\r\nvexp=[328920270 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 150.3\r\nm=[2 1 500 ];\r\nv=Polyglot(m);\r\nvexp=[260322005 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 3.4\r\nm=[5 49 2 ];\r\nv=Polyglot(m);\r\nvexp=[2646 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[47 47 500 ];\r\nv=Polyglot(m);\r\nvexp=[237431455 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[40 40 500 ];\r\nv=Polyglot(m);\r\nvexp=[29203332 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[43 41 500 ];\r\nv=Polyglot(m);\r\nvexp=[376005947 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[50 47 500 ];\r\nv=Polyglot(m);\r\nvexp=[378681068 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[47 50 500 ];\r\nv=Polyglot(m);\r\nvexp=[795014271 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 1.6\r\nm=[42 44 1 ];\r\nv=Polyglot(m);\r\nvexp=[44 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[40 41 500 ];\r\nv=Polyglot(m);\r\nvexp=[506257932 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[5 4 497 ];\r\nv=Polyglot(m);\r\nvexp=[272829097 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 1.7\r\nm=[50 50 1 ];\r\nv=Polyglot(m);\r\nvexp=[50 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 3.7\r\nm=[50 50 2 ];\r\nv=Polyglot(m);\r\nvexp=[5000 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[43 44 500 ];\r\nv=Polyglot(m);\r\nvexp=[607981550 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[50 49 500 ];\r\nv=Polyglot(m);\r\nvexp=[267081842 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[48 44 500 ];\r\nv=Polyglot(m);\r\nvexp=[612852205 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[45 48 500 ];\r\nv=Polyglot(m);\r\nvexp=[652373815 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[5 5 497 ];\r\nv=Polyglot(m);\r\nvexp=[336290141 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[41 42 500 ];\r\nv=Polyglot(m);\r\nvexp=[50517743 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[46 46 500 ];\r\nv=Polyglot(m);\r\nvexp=[251353420 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[45 49 500 ];\r\nv=Polyglot(m);\r\nvexp=[66724508 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[50 44 500 ];\r\nv=Polyglot(m);\r\nvexp=[390526622 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[45 47 500 ];\r\nv=Polyglot(m);\r\nvexp=[37814577 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[47 49 500 ];\r\nv=Polyglot(m);\r\nvexp=[923599754 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[44 48 500 ];\r\nv=Polyglot(m);\r\nvexp=[872350727 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[43 50 500 ];\r\nv=Polyglot(m);\r\nvexp=[668567771 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[41 4 498 ];\r\nv=Polyglot(m);\r\nvexp=[111334900 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 3.6\r\nm=[43 45 2 ];\r\nv=Polyglot(m);\r\nvexp=[3960 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 1.7\r\nm=[4 5 2 ];\r\nv=Polyglot(m);\r\nvexp=[45 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[40 49 500 ];\r\nv=Polyglot(m);\r\nvexp=[281852157 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[43 48 500 ];\r\nv=Polyglot(m);\r\nvexp=[884129281 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[41 48 500 ];\r\nv=Polyglot(m);\r\nvexp=[216141546 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[40 42 500 ];\r\nv=Polyglot(m);\r\nvexp=[488528258 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 3.3\r\nm=[5 42 2 ];\r\nv=Polyglot(m);\r\nvexp=[1974 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 1.7\r\nm=[45 45 1 ];\r\nv=Polyglot(m);\r\nvexp=[45 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[46 48 500 ];\r\nv=Polyglot(m);\r\nvexp=[190132182 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 0.3\r\nm=[1 2 1 ];\r\nv=Polyglot(m);\r\nvexp=[2 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T 3.6\r\nm=[47 42 2 ];\r\nv=Polyglot(m);\r\nvexp=[3738 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[4 45 499 ];\r\nv=Polyglot(m);\r\nvexp=[999945335 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[44 40 500 ];\r\nv=Polyglot(m);\r\nvexp=[53296911 ];\r\nassert(isequal(vexp,v))\r\n%%\r\n% T Inf\r\nm=[50 50 500 ];\r\nv=Polyglot(m);\r\nvexp=[3178118 ];\r\nassert(isequal(vexp,v))\r\n\r\n\r\n\r\ntoc\r\n\r\n%%\r\n% Stacy992 March 12, 2016\r\n% import java.util.*;\r\n% public class c {\r\n% \tpublic static long[][] memo;\r\n% \tpublic static long mod = 1000000007;\r\n% \tpublic static int c, v, l;\r\n% \tpublic static void main(String[] args){\r\n% \t\tScanner in = new Scanner(System.in);\r\n% \t\tint t = in.nextInt();\r\n% \t\tfor(int z = 1;z\u003c=t;z++){\r\n% \t\t\tc = in.nextInt();\r\n% \t\t\tv = in.nextInt();\r\n% \t\t\tl = in.nextInt();\r\n% \t\t\tmemo = new long[2][l];\r\n% \t\t\tfor(int i = 0;i\u003c2;i++){\r\n% \t\t\t\tArrays.fill(memo[i], -1);\r\n% \t\t\t}\r\n% \t\t\t\r\n% \t\t\tSystem.out.println(\"Case #\"+z+\": \"+go(0, 0));\r\n% \t\t}\r\n% \t}\r\n% \tpublic static long go(int flag, int pos){\r\n% \t\tif(pos == l){\r\n% \t\t\tif(flag == 1){\r\n% \t\t\t\treturn 0;\r\n% \t\t\t}\r\n% \t\t\treturn 1;\r\n% \t\t}\r\n% \t\t\r\n% \t\tif(memo[flag][pos] != -1){\r\n% \t\t\treturn memo[flag][pos];\r\n% \t\t}\r\n% \t\t\r\n% \t\tlong ans = 0;\r\n% \t\tans = (ans+(go(0, pos+1)*v))%mod;\r\n% \t\tif(flag != 1){\r\n% \t\t\tans = (ans+(go(1, pos+1)*c))%mod;\r\n% \t\t}\r\n% \t\treturn memo[flag][pos] = ans;\r\n% \t}\r\n% }\r\n\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":7,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-03-19T20:50:33.000Z","updated_at":"2016-03-19T23:05:52.000Z","published_at":"2016-03-19T23:05:52.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis Challenge is derived from\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://code.google.com/codejam/contest/8274486/dashboard#s=p2\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eGJam March 2016 Annual I/O for Polynesiaglot\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. This is the Large input set. The max Qraw is 100^500, (V+C)^L.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe GJam story goes that words are such that consonants are always followed by a vowel. Determine the number of possible words of length L using C consonants and V vowels. The final Q is to be modulo of the prime 1E9+7.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eInput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e [C V L] , C[1,50], V[1,50], 1\u0026lt;=L\u0026lt;=500\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e [Q] max Qraw is 100^500; Q=mod(Qraw,1E9+7)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eExamples:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e [C V L] [Q]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[[1 1 4] [5] {aaaa,aaba,abaa,baaa,baba}  invalid are {bbaa, aaab} \\n[1 2 2] [6] {aa,ae,ba,be,ee,ea} invalid are {ab,eb,bb}]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://code.google.com/codejam\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eGoogle Code Jam 2016 Open Qualifier: April 8, 2016\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eTheory:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e This is a huge value problem, on the order of (C+V)^L, thus brute force will not work. This is also a probability tree type problem. Tree calculations can be reduced to a linear in L evaluation. Inspection shows Q(1)=V, Q(2)=V^2, L=3 Q(3)=V^3+V*C*V+C*V^2 = V*Q(L-1)+V*C*Q(L-2)+C*Q(L-1). There are no Cs at the Q1 level since can not end in a C. Qnext=f(Q(-1),Q(-2)). Qfinal=Q+C*Q(L-1)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[Q3    V          C\\nQ2  V   C       V\\nQ1 V   V       V]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eOne method to succeed in this problem is to use the java capability of Matlab.\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/1833-usage-of-java-math-add-multiply-pow\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCody Java Challenge\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. The primary reference sites are\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Number.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eJava Math\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigDecimal.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eJava BigDecimal\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigInteger.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eJava BigInteger\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. The Java solution by the winner Stacy is included at the bottom of the test suite.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"}],"term":"tag:\"java\"","current_player_id":null,"fields":[{"name":"page","type":"integer","callback":null,"default":1,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"per_page","type":"integer","callback":null,"default":50,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"sort","type":"string","callback":null,"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"body","type":"text","callback":null,"default":"*:*","directive":null,"facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":false},{"name":"group","type":"string","callback":null,"default":null,"directive":"group","facet":true,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"difficulty_rating_bin","type":"string","callback":null,"default":null,"directive":"difficulty_rating_bin","facet":true,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"id","type":"integer","callback":null,"default":null,"directive":"id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"tag","type":"string","callback":null,"default":null,"directive":"tag","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"product","type":"string","callback":null,"default":null,"directive":"product","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"created_at","type":"timeframe","callback":{},"default":null,"directive":"created_at","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"profile_id","type":"integer","callback":null,"default":null,"directive":"author_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"created_by","type":"string","callback":null,"default":null,"directive":"author","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"player_id","type":"integer","callback":null,"default":null,"directive":"solver_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"player","type":"string","callback":null,"default":null,"directive":"solver","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"solvers_count","type":"integer","callback":null,"default":null,"directive":"solvers_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"comments_count","type":"integer","callback":null,"default":null,"directive":"comments_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"likes_count","type":"integer","callback":null,"default":null,"directive":"likes_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"leader_id","type":"integer","callback":null,"default":null,"directive":"leader_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"leading_solution","type":"integer","callback":null,"default":null,"directive":"leading_solution","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true}],"filters":[{"name":"asset_type","type":"string","callback":null,"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":"\"cody:problem\"","prepend":true},{"name":"profile_id","type":"integer","callback":{},"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":"author_id","static":null,"prepend":true}],"query":{"params":{"per_page":50,"term":"tag:\"java\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"java\"","","\"","java","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f7361fdda28\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f7361fdd988\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f7361fdd0c8\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f7361fddca8\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f7361fddc08\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f7361fddb68\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f7361fddac8\u003e":"tag:\"java\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f7361fddac8\u003e":"tag:\"java\""},"queried_facets":{}},"query_backend":{"connection":{"configuration":{"index_url":"http://index-op-v2/solr/","query_url":"http://search-op-v2/solr/","direct_access_index_urls":["http://index-op-v2/solr/"],"direct_access_query_urls":["http://search-op-v2/solr/"],"timeout":10,"vhost":"search","exchange":"search.topic","heartbeat":30,"pre_index_mode":false,"host":"rabbitmq-eks","port":5672,"username":"search","password":"J3bGPZzQ7asjJcCk","virtual_host":"search","indexer":"amqp","http_logging":"true","core":"cody"},"query_connection":{"uri":"http://search-op-v2/solr/cody/","proxy":null,"connection":{"parallel_manager":null,"headers":{"User-Agent":"Faraday v1.0.1"},"params":{},"options":{"params_encoder":"Faraday::FlatParamsEncoder","proxy":null,"bind":null,"timeout":null,"open_timeout":null,"read_timeout":null,"write_timeout":null,"boundary":null,"oauth":null,"context":null,"on_data":null},"ssl":{"verify":true,"ca_file":null,"ca_path":null,"verify_mode":null,"cert_store":null,"client_cert":null,"client_key":null,"certificate":null,"private_key":null,"verify_depth":null,"version":null,"min_version":null,"max_version":null},"default_parallel_manager":null,"builder":{"adapter":{"name":"Faraday::Adapter::NetHttp","args":[],"block":null},"handlers":[{"name":"Faraday::Response::RaiseError","args":[],"block":null}],"app":{"app":{"ssl_cert_store":{"verify_callback":null,"error":null,"error_string":null,"chain":null,"time":null},"app":{},"connection_options":{},"config_block":null}}},"url_prefix":"http://search-op-v2/solr/cody/","manual_proxy":false,"proxy":null},"update_format":"RSolr::JSON::Generator","update_path":"update","options":{"url":"http://search-op-v2/solr/cody"}}},"query":{"params":{"per_page":50,"term":"tag:\"java\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"java\"","","\"","java","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f7361fdda28\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f7361fdd988\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f7361fdd0c8\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f7361fddca8\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f7361fddc08\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f7361fddb68\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f7361fddac8\u003e":"tag:\"java\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f7361fddac8\u003e":"tag:\"java\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":1854,"difficulty_rating":"easy-medium"},{"id":55715,"difficulty_rating":"easy-medium"},{"id":55710,"difficulty_rating":"easy-medium"},{"id":1833,"difficulty_rating":"easy-medium"},{"id":1855,"difficulty_rating":"medium"},{"id":55705,"difficulty_rating":"medium"},{"id":55695,"difficulty_rating":"medium"},{"id":2325,"difficulty_rating":"medium"},{"id":42779,"difficulty_rating":"medium"}]}}