{"id":42371,"date":"2023-02-23T12:56:39","date_gmt":"2023-02-23T09:26:39","guid":{"rendered":"https:\/\/quera.org\/blog\/?p=42371"},"modified":"2023-02-23T12:56:42","modified_gmt":"2023-02-23T09:26:42","slug":"newbies-2013-2014-solutions","status":"publish","type":"post","link":"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/","title":{"rendered":"\u0631\u0627\u0647\u200c\u062d\u0644\u200c\u0647\u0627\u06cc \u0645\u0633\u0627\u0628\u0642\u0647 \u0627\u0644\u06af\u0648\u0631\u06cc\u062a\u0645 Newbies 2013-2014"},"content":{"rendered":"\n<p>\u0627\u06cc\u0646 \u0645\u0633\u0627\u0628\u0642\u0647 \u062f\u0631 \u0633\u0627\u0644 \u06f2\u06f0\u06f1\u06f3 \u062f\u0631 \u00ab\u062f\u0627\u0646\u0634\u06af\u0627\u0647 \u0634\u0647\u06cc\u062f \u0628\u0647\u0634\u062a\u06cc\u00bb \u0628\u0631\u06af\u0632\u0627\u0631 \u0634\u062f\u0647 \u0627\u0633\u062a. \u062a\u06cc\u0645 \u0637\u0631\u0627\u062d\u0627\u0646 \u0627\u06cc\u0646 \u0645\u0633\u0627\u0628\u0642\u0647 \u00ab\u0627\u0645\u06cc\u0646 \u06a9\u0631\u06cc\u0645\u06cc\u00bb\u060c \u00ab\u0641\u062a\u0627 \u0644\u0648\u0627\u0633\u0627\u0646\u06cc\u00bb\u060c \u00ab\u0641\u0631\u0632\u0627\u062f \u0634\u0631\u0628\u0627\u0641\u06cc\u0627\u0646\u00bb\u060c \u00ab\u0627\u062d\u0633\u0627\u0646 \u0641\u0631\u062c\u200c\u0632\u0627\u062f\u0647\u00bb\u060c \u00ab\u0645\u0647\u0631\u062f\u0627\u062f \u0639\u0631\u0628\u200c\u067e\u0648\u0631\u00bb\u060c \u00ab\u0645\u062d\u0633\u0646 \u0633\u062c\u0627\u062f\u06cc\u200c\u062a\u0628\u0627\u0631\u00bb\u060c \u00ab\u0639\u0644\u06cc \u0637\u0627\u0647\u0631\u06cc\u00bb \u0648 \u00ab\u0627\u0645\u06cc\u0631\u062d\u0633\u06cc\u0646 \u0634\u0627\u067e\u0648\u0631\u06cc\u00bb \u0628\u0648\u062f\u0646\u062f. <\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_81 counter-hierarchy ez-toc-counter-rtl ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title ez-toc-toggle\" style=\"cursor:pointer\">\u0641\u0647\u0631\u0633\u062a \u0645\u0637\u0627\u0644\u0628<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/#A_%E2%80%93_Ali_the_Forgetter\" >A \u2013 Ali the Forgetter<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/#B_%E2%80%93_Triangulum_Number_or_rebmuN_mulugnai\" >B \u2013 Triangulum Number or rebmuN mulugnai<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/#C_%E2%80%93_Shekami_Way_Galaxy\" >C \u2013 Shekami Way Galaxy<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/#D_%E2%80%93_The_Bro_Code\" >D \u2013 The Bro Code<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/#E_%E2%80%93_Dormitory_Nights\" >E \u2013 Dormitory Nights<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/#F_%E2%80%93_Road_to_Kanpur\" >F \u2013 Road to Kanpur<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/#G_%E2%80%93_Gym_Contest\" >G \u2013 Gym Contest<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/#H_%E2%80%93_Exchange_Rate\" >H \u2013 Exchange Rate<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/#I_%E2%80%93_Jungle_of_Coconuts\" >I \u2013 Jungle of Coconuts<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/#J_%E2%80%93_Shamirs_Birthday\" >J \u2013 Shamir\u2019s Birthday<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"has-medium-font-size wp-block-heading\" id=\"h-a-ali-the-forgetter\"><span class=\"ez-toc-section\" id=\"A_%E2%80%93_Ali_the_Forgetter\"><\/span><a href=\"https:\/\/quera.org\/problemset\/171795\/\"><strong>A \u2013 Ali the Forgetter<\/strong><\/a><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u0628\u0627 \u062a\u0648\u062c\u0647 \u0628\u0647 \u0627\u06cc\u0646\u06a9\u0647 \u062f\u0631 \u0622\u062e\u0631\u06cc\u0646 \u0627\u062a\u0627\u0642 \u0645\u0648\u0628\u0627\u06cc\u0644 \u0631\u0627 \u067e\u06cc\u062f\u0627 \u0645\u06cc\u200c\u06a9\u0646\u06cc\u0645\u060c \u067e\u0633 \u0628\u0627\u06cc\u062f <span class=\"katex-eq\" data-katex-display=\"false\">N<\/span> \u0627\u062a\u0627\u0642 \u0631\u0627 \u0628\u06af\u0631\u062f\u06cc\u0645 \u0648 <span class=\"katex-eq\" data-katex-display=\"false\">N-1<\/span> \u0628\u06cc\u0646 \u0627\u062a\u0627\u0642\u200c\u0647\u0627 \u062d\u0631\u06a9\u062a \u06a9\u0646\u06cc\u0645. \u067e\u0633 \u067e\u0627\u0633\u062e \u0628\u0631\u0627\u0628\u0631 <span class=\"katex-eq\" data-katex-display=\"false\">N \\times t_1 + (N-1)\\times t_2\\space<\/span> \u0647\u0633\u062a.<\/p>\n\n\n\n<p>\u067e\u06cc\u0686\u06cc\u062f\u06af\u06cc \u0632\u0645\u0627\u0646\u06cc:<\/p>\n\n\n\n<div class=\"wp-block-katex-display-block katex-eq\" data-katex-display=\"true\"><pre>\\mathcal{O}(T)<\/pre><\/div>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"cpp\" class=\"language-cpp line-numbers\">#include &lt;bits\/stdc++.h&gt;\n\nusing namespace std;\n\nint main()\n{\n\tint tc, N, t1, t2;\n\tcin &gt;&gt; tc;\n\twhile(tc--)\n\t{\n\t\tcin &gt;&gt; N &gt;&gt; t1 &gt;&gt; t2;\n\t\tcout &lt;&lt; N*t1+(N-1)*t2 &lt;&lt; '\\n';\n\t}\n\t\n\treturn 0;\n}<\/code><\/pre>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"has-medium-font-size wp-block-heading\" id=\"h-b-triangulum-number-or-rebmun-mulugnai\"><span class=\"ez-toc-section\" id=\"B_%E2%80%93_Triangulum_Number_or_rebmuN_mulugnai\"><\/span><a href=\"https:\/\/quera.org\/problemset\/171796\/\"><strong>B \u2013 Triangulum Number or rebmuN mulugnai<\/strong><\/a><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u06a9\u0627\u0641\u06cc\u0633\u062a \u0647\u0631 \u0628\u0627\u0631 \u0639\u062f\u062f \u0631\u0627 \u0628\u0647 \u062a\u0648\u0627\u0646 \u062f\u0648 \u0631\u0633\u0627\u0646\u062f\u0647 \u0648 \u0645\u0639\u06a9\u0648\u0633 \u0622\u0646 \u0631\u0627 \u0686\u0627\u067e \u06a9\u0646\u06cc\u0645.<\/p>\n\n\n\n<p>\u067e\u06cc\u0686\u06cc\u062f\u06af\u06cc \u0632\u0645\u0627\u0646\u06cc:<\/p>\n\n\n\n<div class=\"wp-block-katex-display-block katex-eq\" data-katex-display=\"true\"><pre>\\mathcal{O}(T)<\/pre><\/div>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"cpp\" class=\"language-cpp line-numbers\">#include &lt;bits\/stdc++.h&gt;\n\nusing namespace std;\n\nint main()\n{\n\twhile(true)\n\t{\n\t\tstring s = \"\";\n\t\tcin &gt;&gt; s;\n\t\tif(s == \"\")break;\n\t\tstring t = to_string(stol(s)*stol(s));\n\t\treverse(t.begin(), t.end());\n\t\tcout &lt;&lt; t &lt;&lt; '\\n';\n\t}\n\t\n\treturn 0;\n}<\/code><\/pre>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"has-medium-font-size wp-block-heading\" id=\"h-c-shekami-way-galaxy\"><span class=\"ez-toc-section\" id=\"C_%E2%80%93_Shekami_Way_Galaxy\"><\/span><a href=\"https:\/\/quera.org\/problemset\/171797\/\"><strong>C \u2013 Shekami Way Galaxy<\/strong><\/a><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u0647\u0646\u06af\u0627\u0645\u06cc \u06a9\u0647 \u062f\u0648 \u06a9\u0631\u0647 \u0628\u0627 \u0634\u0639\u0627\u0639 \u0628\u0631\u0627\u0628\u0631 \u062f\u0627\u0631\u06cc\u0645\u060c \u0647\u0631\u06a9\u062f\u0627\u0645 \u0646\u06cc\u0645\u06cc \u0627\u0632 \u06a9\u0631\u0647 \u062f\u06cc\u06af\u0631 \u0631\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u062f \u0628\u0628\u06cc\u0646\u062f. \u0628\u0647 \u0639\u0628\u0627\u0631\u062a\u06cc \u0646\u06cc\u0645\u06a9\u0631\u0647\u200c\u0647\u0627\u06cc \u0628\u06cc\u0646 \u0635\u0641\u062d\u0627\u062a \u0639\u0645\u0648\u062f \u0628\u0631 \u067e\u0627\u0631\u0647\u200c\u062e\u0637 \u0648\u0627\u0635\u0644 \u062f\u0648 \u0645\u0631\u06a9\u0632 \u06a9\u0631\u0647 \u0642\u0627\u0628\u0644\u06cc\u062a \u062f\u06cc\u062f\u0647 \u0634\u062f\u0646 \u062f\u0627\u0631\u0646\u062f. \u0627\u0632 \u0622\u0646\u062c\u0627 \u06a9\u0647 \u0645\u062e\u062a\u0635\u0627\u062a \u06a9\u0631\u0647\u200c\u0647\u0627 \u062f\u0648 \u0628\u0639\u062f\u06cc \u0647\u0633\u062a\u0646\u062f \u06cc\u0639\u0646\u06cc \u0645\u0631\u06a9\u0632 \u0647\u0645\u0647 \u0631\u0648\u06cc \u0635\u0641\u062d\u0647 \u0648\u0627\u062d\u062f \u0642\u0631\u0627\u0631 \u062f\u0627\u0631\u062f\u060c \u0645\u06cc\u200c\u062a\u0648\u0627\u0646 \u0641\u0631\u0636 \u06a9\u0631\u062f \u0628\u0627 \u062a\u0639\u062f\u0627\u062f\u06cc \u062f\u0627\u06cc\u0631\u0647 \u062f\u0631 \u0635\u0641\u062d\u0647 \u0645\u0648\u0627\u062c\u0647 \u0647\u0633\u062a\u06cc\u0645 \u0648 \u062d\u0627\u0644 \u0645\u06cc\u200c\u062f\u0627\u0646\u06cc\u0645:<\/p>\n\n\n\n<p>\u0646\u0633\u0628\u062a \u0645\u062d\u06cc\u0637 \u067e\u0646\u0647\u0627\u0646 \u062f\u0627\u06cc\u0631\u0647 \u0628\u0647 \u0645\u062d\u06cc\u0637 \u06a9\u0644 \u062f\u0627\u06cc\u0631\u0647 \u0628\u0631\u0627\u0628\u0631 \u0646\u0633\u0628\u062a \u0645\u0633\u0627\u062d\u062a \u067e\u0646\u0647\u0627\u0646 \u06a9\u0631\u0647 \u0628\u0647 \u06a9\u0644 \u06a9\u0631\u0647 \u0627\u0633\u062a<\/p>\n\n\n\n<p>\u062d\u0627\u0644 \u06a9\u0627\u0641\u06cc \u0627\u0633\u062a \u0628\u0631\u0627\u06cc \u0647\u0631 \u06a9\u0631\u0647 \u0646\u0642\u0627\u0637 \u067e\u0646\u0647\u0627\u0646 \u0631\u0648\u06cc \u0627\u0633\u062a\u0648\u0627 \u0622\u0646 \u0631\u0627 \u062d\u0633\u0627\u0628 \u06a9\u0631\u062f\u0647 \u0648 \u062c\u0648\u0627\u0628 \u0631\u0627 \u0628\u0647 \u06a9\u0645\u06a9 \u0631\u0627\u0628\u0637\u0647 \u0628\u0627\u0644\u0627 \u0645\u062d\u0627\u0633\u0628\u0647 \u06a9\u0646\u06cc\u0645. \u0644\u0627\u0632\u0645 \u0628\u0647 \u0630\u06a9\u0631 \u0627\u0633\u062a \u0645\u0633\u0627\u062d\u062a \u06a9\u0631\u0647 \u0627\u0632 \u0631\u0627\u0628\u0637\u0647 \u0632\u06cc\u0631 \u0628\u062f\u0633\u062a \u0645\u06cc\u200c\u0622\u06cc\u062f:<\/p>\n\n\n\n<div class=\"wp-block-katex-display-block katex-eq\" data-katex-display=\"true\"><pre> S = 4 \\times \\pi \\times R^2<\/pre><\/div>\n\n\n\n<p>\u067e\u06cc\u0686\u06cc\u062f\u06af\u06cc \u0632\u0645\u0627\u0646\u06cc:<\/p>\n\n\n\n<div class=\"wp-block-katex-display-block katex-eq\" data-katex-display=\"true\"><pre>\\mathcal{O}(T \\times N \\times N \\times \\log(N))<\/pre><\/div>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"cpp\" class=\"language-cpp line-numbers\">#include &lt;bits\/stdc++.h&gt;\n\nusing namespace std;\n\ntypedef long double ld;\n\ninline ld front(ld degree){return (degree &gt;= 180? degree-180: degree+180);}\ninline ld dis(ld x1, ld y1, ld x2, ld y2){return sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));}\ninline ld rad_to_deg(ld x){return x\/2\/M_PI*360;}\ninline ld Seen(ld x1, ld y1, ld x2, ld y2)\n{\n\tif(y1 &gt; y2)\n\t\treturn front(Seen(x2, y2, x1, y1));\n\tld R = dis(x1, y1, x2, y2), D = dis(x1+R, y1, x2, y2);\n\treturn rad_to_deg(asin(D\/2\/R)*2);\n}\n\ninline ld solve()\n{\n\tint n;\n\tld r, ans = 0;\n\tcin &gt;&gt; n &gt;&gt; r;\n\tint x[n], y[n];\n\tfor(int i = 0; i &lt; n; i++) cin &gt;&gt; x[i] &gt;&gt; y[i];\n\tvector&lt;ld&gt; seen[n];\n\tfor(int i = 0; i &lt; n; i++)\n\t\tfor(int j = i+1; j &lt; n; j++)\n\t\t{\n\t\t\tld degree = Seen(x[i], y[i], x[j], y[j]);\n\t\t\tseen[i].push_back(degree);\n\t\t\tseen[j].push_back(front(degree));\n\t\t}\n\tfor(int i = 0; i &lt; n; i++)\n\t{\n\t\tsort(seen[i].begin(), seen[i].end());\n\t\tld unvisible_degree = 0;\n\t\tfor(int j = 0; j &lt; n-2; j++)\n\t\t\tunvisible_degree += max((ld)0, seen[i][j+1]-seen[i][j]-180);\n\t\tunvisible_degree += max((ld)0, (-seen[i].back()+360)+seen[i].front()-180);\n\t\tans += M_PI*4*r*r*unvisible_degree\/360;\n\t}\n\treturn ans;\n}\n\nint main()\n{\n\tios_base::sync_with_stdio(false); cin.tie(0);\n\tint tc;\n\tcin &gt;&gt; tc;\n\tfor(int i = 1; i &lt;= tc; i++)\n\t\tcout &lt;&lt; \"Case #\" &lt;&lt; i &lt;&lt; \": \" &lt;&lt; fixed &lt;&lt; setprecision(3) &lt;&lt; solve() &lt;&lt; '\\n';\n\t\n\treturn 0;\n}<\/code><\/pre>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"has-medium-font-size wp-block-heading\" id=\"h-d-the-bro-code\"><span class=\"ez-toc-section\" id=\"D_%E2%80%93_The_Bro_Code\"><\/span><a href=\"https:\/\/quera.org\/problemset\/171788\/\"><strong>D \u2013 The Bro Code<\/strong><\/a><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u0628\u0627 \u062a\u0648\u062c\u0647 \u0628\u0647 \u0631\u0627\u0628\u0637\u0647 \u062f\u0627\u062f\u0647 \u0634\u062f\u0647\u060c \u0627\u0648\u0644 <span class=\"katex-eq\" data-katex-display=\"false\">p<\/span> \u0631\u0627 \u0628\u062f\u0633\u062a \u0645\u06cc\u200c\u0622\u0648\u0631\u06cc\u0645. \u062d\u0627\u0644 \u0628\u0627 \u062a\u0648\u062c\u0647 \u0628\u0647 \u0635\u0648\u0631\u062a \u0645\u0633\u0626\u0644\u0647\u060c \u067e\u0627\u0633\u062e \u0642\u0633\u0645\u062a \u062f\u0648\u0645 \u0628\u0631\u0627\u0628\u0631 <span class=\"katex-eq\" data-katex-display=\"false\">8 \\times p - {h}&#039; \\times (b-1)<\/span> \u0627\u0633\u062a.<\/p>\n\n\n\n<p>\u067e\u06cc\u0686\u06cc\u062f\u06af\u06cc \u0632\u0645\u0627\u0646\u06cc:<\/p>\n\n\n\n<div class=\"wp-block-katex-display-block katex-eq\" data-katex-display=\"true\"><pre>\\mathcal{O}(T)<\/pre><\/div>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"cpp\" class=\"language-cpp line-numbers\">#include &lt;bits\/stdc++.h&gt;\n\nusing namespace std;\n\nint main()\n{\n\tint tc, m, t, b, hp, p;\n\tcin &gt;&gt; tc;\n\twhile(tc--)\n\t{\n\t\tcin &gt;&gt; m &gt;&gt; t &gt;&gt; b;\n\t\thp = m\/t;\n\t\tp = ceil(1.0*m*b\/t\/8);\n\t\tcout &lt;&lt; p &lt;&lt; ' ' &lt;&lt; 8*p-hp*(b-1) &lt;&lt; '\\n';\n\t}\n\t\n\treturn 0;\n}<\/code><\/pre>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"has-medium-font-size wp-block-heading\" id=\"h-e-dormitory-nights\"><span class=\"ez-toc-section\" id=\"E_%E2%80%93_Dormitory_Nights\"><\/span><a href=\"https:\/\/quera.org\/problemset\/171789\/\"><strong>E \u2013 Dormitory Nights<\/strong><\/a><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u0628\u0631\u0627\u06cc \u062d\u0644 \u0633\u0624\u0627\u0644 \u06a9\u0627\u0641\u06cc \u0627\u0633\u062a \u0622\u0631\u0627\u06cc\u0647\u200c\u0627\u06cc \u0627\u0632 \u0645\u06cc\u0632\u0627\u0646 \u0628\u062f\u0647\u06cc \u0648 \u0637\u0644\u0628\u06a9\u0627\u0631\u06cc \u0647\u0631\u06a9\u0633 \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u06cc\u062f \u0648 \u0622\u0646 \u0631\u0627 \u0628\u0627 \u067e\u0631\u062f\u0627\u0632\u0634 \u0647\u0631 \u062e\u0637 \u0628\u0647\u200c\u0631\u0648\u0632\u0631\u0633\u0627\u0646\u06cc \u06a9\u0646\u06cc\u062f.<\/p>\n\n\n\n<p>\u067e\u06cc\u0686\u06cc\u062f\u06af\u06cc \u0632\u0645\u0627\u0646\u06cc:<\/p>\n\n\n\n<div class=\"wp-block-katex-display-block katex-eq\" data-katex-display=\"true\"><pre>\\mathcal{O}(T \\times L \\times N \\times \\log(L\\times N))<\/pre><\/div>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"cpp\" class=\"language-cpp line-numbers\">#include &lt;bits\/stdc++.h&gt;\nusing namespace std;\n#define ll long long\n#define ld long double\ntypedef pair&lt;int,int&gt; ii;\ntypedef vector&lt;int&gt; vi;\ntypedef vector&lt;ii&gt; vii;\n\n#define mp make_pair\n#define L(s) (int)((s).size())\n#define all(c) (c).begin(), (c).end()\n\nvoid printName(const string &amp; name) {\n    cout &lt;&lt; char(toupper(name[0]));\n    for (int i = 1; i &lt; L(name); i++)\n        cout &lt;&lt; name[i];\n}\n\nvoid make_valid(string &amp; name) {\n    for (int i = 0; i &lt; L(name); i++)\n        if (isalpha(name[i]) &amp;&amp; isupper(name[i]))\n            name[i] = tolower(name[i]);\n}\n\nmap&lt;string, int&gt; money;\n\nvoid end_testcase() {\n    static int tc = 0;\n    cout &lt;&lt; \"Case #\" &lt;&lt; ++tc &lt;&lt; \":\" &lt;&lt; endl;\n    vector&lt;pair&lt;string, int&gt; &gt; dept, cred;\n    for (map&lt;string,int&gt;::iterator it = money.begin(); it != money.end(); it++)\n        if (it-&gt;second &gt; 0)\n            cred.push_back(*it);\n        else if (it-&gt;second &lt; 0)\n            dept.push_back(*it);\n    cout &lt;&lt; \"Debtors:\" &lt;&lt; endl;\n    for (int i = 0; i &lt; L(dept); i++) {\n        printName(dept[i].first);\n        cout &lt;&lt; \" owes \" &lt;&lt; -dept[i].second &lt;&lt; \" Tomans.\" &lt;&lt; endl;\n    }\n    cout &lt;&lt; \"Creditors:\" &lt;&lt; endl;\n    for (int i = 0; i &lt; L(cred); i++) {\n        printName(cred[i].first);\n        cout &lt;&lt; \" paid \" &lt;&lt; cred[i].second &lt;&lt; \" Tomans.\" &lt;&lt; endl;\n    }\n    money.clear();\n}\n\nint main () {\n    int l;\n    while (cin &gt;&gt; l) {\n        while (l--) {\n            string buyer, temp;\n            int cost, n;\n            cin &gt;&gt; buyer &gt;&gt; cost &gt;&gt; n;\n            make_valid(buyer);\n            money[buyer] += cost;\n            cost \/= n;\n            while (n-- &amp;&amp; cin &gt;&gt; temp) {\n                make_valid(temp);\n                money[temp] -= cost;\n            }\n        }\n        end_testcase();\n    }\n    return 0;\n}<\/code><\/pre>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"has-medium-font-size wp-block-heading\" id=\"h-f-road-to-kanpur\"><span class=\"ez-toc-section\" id=\"F_%E2%80%93_Road_to_Kanpur\"><\/span><a href=\"https:\/\/quera.org\/problemset\/171790\/\"><strong>F \u2013 Road to Kanpur<\/strong><\/a><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u0628\u0631\u0627\u06cc \u062d\u0644 \u0627\u06cc\u0646 \u0633\u0624\u0627\u0644 \u0627\u0632 \u0631\u0648\u0634 \u0628\u0631\u0646\u0627\u0645\u0647\u200c\u0646\u0648\u06cc\u0633\u06cc \u067e\u0648\u06cc\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc\u200c\u06a9\u0646\u06cc\u0645. <span class=\"katex-eq\" data-katex-display=\"false\">dp[i]<\/span> \u0631\u0627 \u0627\u06cc\u0646 \u0686\u0646\u06cc\u0646 \u062a\u0639\u0631\u06cc\u0641 \u0645\u06cc\u200c\u06a9\u0646\u06cc\u0645: \u00ab\u062d\u062f\u0627\u0642\u0644 \u0645\u06cc\u0632\u0627\u0646 \u062e\u0633\u062a\u06af\u06cc \u062f\u0631 \u0631\u0627\u0647 \u0631\u0633\u06cc\u062f\u0646 \u0628\u0647 <span class=\"katex-eq\" data-katex-display=\"false\">i<\/span>\u0645\u06cc\u0646 \u0647\u062a\u0644\u00bb<\/p>\n\n\n\n<p>\u0645\u0634\u062e\u0635\u0627\u064b <span class=\"katex-eq\" data-katex-display=\"false\">dp[n]<\/span> \u062c\u0648\u0627\u0628 \u0645\u0633\u0626\u0644\u0647 \u0627\u0633\u062a \u0648 \u0628\u0631\u0627\u06cc \u0645\u062d\u0627\u0633\u0628\u0647 <span class=\"katex-eq\" data-katex-display=\"false\">dp[i]<\/span> \u06a9\u0627\u0641\u06cc \u0627\u0633\u062a \u0631\u0648\u06cc \u0622\u062e\u0631\u06cc\u0646 \u0647\u062a\u0644 \u0645\u062a\u0648\u0642\u0641 \u0634\u062f\u0647 \u0642\u0628\u0644 \u0627\u0632 <span class=\"katex-eq\" data-katex-display=\"false\">i<\/span> \u062d\u0627\u0644\u062a\u200c\u0628\u0646\u062f\u06cc \u06a9\u0646\u06cc\u0645.<\/p>\n\n\n\n<p>\u067e\u06cc\u0686\u06cc\u062f\u06af\u06cc \u0632\u0645\u0627\u0646\u06cc:<\/p>\n\n\n\n<div class=\"wp-block-katex-display-block katex-eq\" data-katex-display=\"true\"><pre>\\mathcal{O}(T \\times N^2)<\/pre><\/div>\n\n\n\n<p>\u0631\u0627\u0647 \u062f\u06cc\u06af\u0631 \u0627\u06cc\u0646 \u0633\u0624\u0627\u0644 \u06a9\u0647 \u0628\u0647 \u0645\u0631\u0627\u062a\u0628 \u06a9\u0646\u062f\u062a\u0631 \u0627\u0632 \u0627\u06cc\u0646 \u0631\u0627\u0647 \u0627\u0633\u062a \u0645\u0634\u062e\u0635 \u06a9\u0631\u062f\u0646 \u0632\u06cc\u0631\u0645\u062c\u0645\u0648\u0639\u0647\u200c\u0627\u06cc \u0627\u0632 \u0647\u062a\u0644\u200c\u0647\u0627\u0633\u062a \u06a9\u0647 \u0642\u0631\u0627\u0631 \u0627\u0633\u062a \u0628\u0647 \u0627\u0633\u062a\u0631\u0627\u062d\u062a \u062f\u0631 \u0622\u0646 \u0628\u067e\u0631\u062f\u0627\u0632\u06cc\u0645 \u06a9\u0647 \u067e\u06cc\u0686\u06cc\u062f\u06af\u06cc \u0632\u0645\u0627\u0646\u06cc \u0622\u0646<\/p>\n\n\n\n<div class=\"wp-block-katex-display-block katex-eq\" data-katex-display=\"true\"><pre>\\mathcal{O}(T \\times N \\times 2^N)<\/pre><\/div>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"cpp\" class=\"language-cpp line-numbers\">#include &lt;bits\/stdc++.h&gt;\n\nusing namespace std;\n\nint main()\n{\n\tint t;\n\tcin &gt;&gt; t;\n\twhile(t--)\n\t{\n\t\tint n;\n\t\tcin &gt;&gt; n;\n\t\tint A[n], dp[n+1];\n\t\tfor(int i = 0; i &lt; n; i++)\n\t\t\tcin &gt;&gt; A[i];\n\t\tdp[0] = 0;\n\t\tfor(int i = 1; i &lt;= n; i++)\n\t\t{\n\t\t\tdp[i] = abs(A[i-1]-144);\n\t\t\tfor(int j = 1; j &lt; i; j++)\n\t\t\t\tdp[i] = min(dp[i],dp[j]+abs(A[i-1]-A[j-1]-144));\n\t\t}\n\t\tcout &lt;&lt; dp[n] &lt;&lt; '\\n';\n\t}\n\t\n\treturn 0;\n}<\/code><\/pre>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"has-medium-font-size wp-block-heading\" id=\"h-g-gym-contest\"><span class=\"ez-toc-section\" id=\"G_%E2%80%93_Gym_Contest\"><\/span><a href=\"https:\/\/quera.org\/problemset\/171791\/\"><strong>G \u2013 Gym Contest<\/strong><\/a><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u0627\u0648\u0644 \u062b\u0627\u0628\u062a \u0645\u06cc\u200c\u06a9\u0646\u06cc\u0645 \u067e\u0627\u0633\u062e \u067e\u06cc\u0634\u0648\u0646\u062f \u06cc\u0627 \u067e\u0633\u0648\u0646\u062f\u06cc \u0627\u0632 \u0627\u0639\u062f\u0627\u062f \u0627\u0633\u062a. \u0641\u0631\u0636 \u062e\u0644\u0641 \u0627\u06cc\u0646 \u0627\u0633\u062a \u06a9\u0647 \u062c\u0648\u0627\u0628 \u0628\u0627\u0632\u0647 <span class=\"katex-eq\" data-katex-display=\"false\">[L, R]<\/span> \u0628\u0627\u0634\u062f \u0628\u0647 \u0637\u0648\u0631\u06cc \u06a9\u0647 <span class=\"katex-eq\" data-katex-display=\"false\">L &gt; 1<\/span> \u0648 <span class=\"katex-eq\" data-katex-display=\"false\">R &lt; N<\/span>. \u062d\u0627\u0644 \u0636\u0631\u0628 \u0627\u0639\u062f\u0627\u062f \u0642\u0628\u0644 \u0627\u0632 <span class=\"katex-eq\" data-katex-display=\"false\">L<\/span> \u0631\u0627 <span class=\"katex-eq\" data-katex-display=\"false\">a<\/span> \u0648 \u0636\u0631\u0628 \u0627\u0639\u062f\u0627\u062f \u0628\u0639\u062f \u0627\u0632 <span class=\"katex-eq\" data-katex-display=\"false\">R<\/span> \u0631\u0627 <span class=\"katex-eq\" data-katex-display=\"false\">b<\/span> \u062f\u0631 \u0646\u0638\u0631 \u0628\u06af\u06cc\u0631\u06cc\u062f. \u0627\u06af\u0631 \u06cc\u06a9\u06cc \u0627\u0632 \u0627\u06cc\u0646 \u062f\u0648 \u0645\u062b\u0628\u062a \u0628\u0627\u0634\u062f \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u0633\u062a\u06cc\u0645 \u0628\u0627\u0632\u0647 \u0628\u0627 \u0636\u0631\u0628 \u0628\u0632\u0631\u06af\u200c\u062a\u0631\u06cc \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u06cc\u0645 \u0648 \u062f\u0631 \u063a\u06cc\u0631 \u0627\u06cc\u0646\u0635\u0648\u0631\u062a (\u0647\u0631 \u062f\u0648 \u0645\u0646\u0641\u06cc \u0628\u0627\u0634\u0646\u062f) \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u0633\u062a\u06cc\u0645 \u0628\u0627\u0632\u0647 <span class=\"katex-eq\" data-katex-display=\"false\">[1, N]<\/span> \u0631\u0627 \u062e\u0631\u0648\u062c\u06cc \u062f\u0647\u06cc\u0645. \u067e\u0633 \u067e\u0627\u0633\u062e \u067e\u06cc\u0634\u0648\u0646\u062f \u06cc\u0627 \u067e\u0633\u0648\u0646\u062f \u062f\u0646\u0628\u0627\u0644\u0647 \u0627\u0633\u062a.<\/p>\n\n\n\n<p>\u0647\u0645\u0686\u0646\u06cc\u0646 \u0628\u0647\u200c\u0633\u0627\u062f\u06af\u06cc \u0645\u06cc\u200c\u062a\u0648\u0646 \u0646\u0634\u0627\u0646 \u062f\u0627\u062f \u067e\u0627\u0633\u062e \u0628\u0644\u0646\u062f\u062a\u0631\u06cc\u0646 \u067e\u06cc\u0634\u0648\u0646\u062f \u0628\u0627 \u0636\u0631\u0628 \u0627\u0639\u062f\u0627\u062f \u0645\u062b\u0628\u062a \u06cc\u0627 \u0628\u0644\u0646\u062f\u062a\u0631\u06cc\u0646 \u067e\u0633\u0648\u0646\u062f \u0628\u0627 \u0636\u0631\u0628 \u0627\u0639\u062f\u0627\u062f \u0645\u062b\u0628\u062a \u0627\u0633\u062a.<\/p>\n\n\n\n<p>\u0628\u0631\u0627\u06cc \u067e\u06cc\u0627\u062f\u0647\u200c\u0633\u0627\u0632\u06cc \u062f\u0631 \u0632\u0628\u0627\u0646\u200c\u0647\u0627\u06cc\u06cc \u06a9\u0647 \u0627\u0639\u062f\u0627\u062f \u0645\u062d\u062f\u0648\u062f\u06cc\u062a \u062f\u0627\u0631\u0646\u062f \u0645\u0627\u0646\u0646\u062f <code>C++<\/code> \u0645\u06cc\u200c\u062a\u0648\u0627\u0646 \u0627\u0632 \u0631\u0627\u0628\u0637\u0647 \u0632\u06cc\u0631 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0631\u062f.<\/p>\n\n\n\n<div class=\"wp-block-katex-display-block katex-eq\" data-katex-display=\"true\"><pre>a_L \\times a_{L+1} \\times \\dots \\times a_R = 10^{\\log_{10}(a_L)+\\log_{10}(a_{L+1})+\\dots+\\log_{10}(a_R)}<\/pre><\/div>\n\n\n\n<p>\u0648 \u0628\u0647\u200c\u062c\u0627\u06cc \u0645\u0642\u0627\u06cc\u0633\u0647 \u0636\u0631\u0628 \u0627\u0639\u062f\u0627\u062f \u06cc\u06a9 \u0628\u0627\u0632\u0647 \u062c\u0645\u0639 \u0644\u06af\u0627\u0631\u06cc\u062a\u0645 \u0622\u0646\u0647\u0627 \u0631\u0627 \u0628\u0627 \u0647\u0645 \u0645\u0642\u0627\u06cc\u0633\u0647 \u06a9\u0631\u062f.<\/p>\n\n\n\n<p>\u0631\u0627\u0647 \u062f\u06cc\u06af\u0631 \u0647\u0645 \u0628\u0647\u0631\u0647\u200c\u06af\u06cc\u0631\u06cc \u0627\u0632 \u0645\u062d\u062f\u0648\u062f\u06cc\u062a \u0633\u0624\u0627\u0644 \u0627\u0633\u062a \u06a9\u0647 \u06af\u0641\u062a\u0647 \u0634\u062f\u0647 \u0627\u0632 \u0647\u0631 \u06f1\u06f0 \u0639\u062f\u062f \u0645\u062a\u0648\u0627\u0644\u06cc \u062d\u062f\u0627\u0642\u0644 \u06f1 \u0639\u062f\u062f \u0645\u0646\u0641\u06cc \u0627\u0633\u062a. \u067e\u0633 \u0628\u0632\u0631\u06af\u062a\u0631\u06cc\u0646 \u067e\u0633\u0648\u0646\u062f \u0648 \u067e\u06cc\u0634\u0648\u0646\u062f \u0628\u0627 \u0636\u0631\u0628 \u0627\u0639\u062f\u0627\u062f \u0646\u0627\u0645\u0646\u0641\u06cc, \u062d\u062f\u0627\u06a9\u062b\u0631 \u06f1\u06f0 \u0639\u0636\u0648 \u0646\u062f\u0627\u0631\u0646\u062f \u0648 \u062e\u0628 \u0647\u0631\u06a9\u062f\u0627\u0645 \u06a9\u0647 \u0636\u0631\u0628 \u0627\u0639\u062f\u0627\u062f\u06cc \u06a9\u0647 \u0646\u062f\u0627\u0631\u0646\u062f \u06a9\u0645\u062a\u0631 \u0628\u0627\u0634\u062f (\u0627\u0632 \u0646\u0638\u0631 \u0627\u0646\u062f\u0627\u0632\u0647) \u067e\u0627\u0633\u062e \u0645\u0633\u0626\u0644\u0647 \u0627\u0633\u062a.<\/p>\n\n\n\n<p>\u067e\u06cc\u0686\u06cc\u062f\u06af\u06cc \u0632\u0645\u0627\u0646\u06cc:<\/p>\n\n\n\n<div class=\"wp-block-katex-display-block katex-eq\" data-katex-display=\"true\"><pre>\\mathcal{O}(T \\times N)<\/pre><\/div>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"cpp\" class=\"language-cpp line-numbers\">#include &lt;bits\/stdc++.h&gt;\n\nusing namespace std;\n\nint main()\n{\n\tint t;\n\tcin &gt;&gt; t;\n\twhile(t--)\n\t{\n\t\tint n;\n\t\tcin &gt;&gt; n;\n\t\tint A[n];\n\t\tfor(int i = 0; i &lt; n; i++)\n\t\t\tcin &gt;&gt; A[i];\n\t\tif(n == 1)\n\t\t{\n\t\t\tcout &lt;&lt; \"1 1\\n\";\n\t\t\tcontinue;\n\t\t}\n\t\tbool prefix_negative = false, suffix_negative = false;\n\t\tdouble prefix = 0, suffix = 0;\n\t\tpair&lt;double, int&gt; prefix_max, suffix_max;\n\t\tfor(int i = 0; i &lt; n; i++)\n\t\t{\n\t\t\tprefix_negative ^= (A[i] &lt; 0);\n\t\t\tprefix += log2(abs(A[i]));\n\t\t\tif(!prefix_negative)\n\t\t\t\tprefix_max = {prefix, i};\n\t\t}\n\t\tfor(int i = n-1; i &gt;= 0; i--)\n\t\t{\n\t\t\tsuffix_negative ^= (A[i] &lt; 0);\n\t\t\tsuffix += log2(abs(A[i]));\n\t\t\tif(!suffix_negative)\n\t\t\t\tsuffix_max = {suffix, i};\n\t\t}\n\t\tif(suffix_max.first &gt; prefix_max.first)\n\t\t\tcout &lt;&lt; suffix_max.second+1 &lt;&lt; ' ' &lt;&lt; n &lt;&lt; '\\n';\n\t\telse\n\t\t\tcout &lt;&lt; 1 &lt;&lt; ' ' &lt;&lt; prefix_max.second+1 &lt;&lt; '\\n';\n\t}\n\t\n\treturn 0;\n}<\/code><\/pre>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"has-medium-font-size wp-block-heading\" id=\"h-h-exchange-rate\"><span class=\"ez-toc-section\" id=\"H_%E2%80%93_Exchange_Rate\"><\/span><a href=\"https:\/\/quera.org\/problemset\/171792\/\"><strong>H \u2013 Exchange Rate<\/strong><\/a><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u0627\u0628\u062a\u062f\u0627 \u0645\u0627 \u0645\u0633\u0626\u0644\u0647 \u0631\u0627 \u0628\u0631\u0627\u06cc <span class=\"katex-eq\" data-katex-display=\"false\">d = n<\/span> \u062d\u0644 \u0645\u06cc\u200c\u06a9\u0646\u06cc\u0645. \u06cc\u0639\u0646\u06cc \u0642\u06cc\u0645\u062a\u200c\u0647\u0627\u06cc \u0627\u0648\u0644\u06cc\u0647 \u0645\u0645\u06a9\u0646 \u0628\u0627\u062a\u0631\u06cc \u0631\u0627 \u062d\u0633\u0627\u0628 \u0645\u06cc\u200c\u06a9\u0646\u06cc\u0645. \u0633\u067e\u0633 \u0628\u0627 \u062f\u0627\u0634\u062a\u0646 \u0622\u0646 \u0628\u0627\u0632\u0647 \u0642\u06cc\u0645\u062a\u06cc \u062f\u0631 \u0647\u0631 \u0631\u0648\u0632\u06cc \u0628\u0647\u200c\u0633\u0627\u062f\u06af\u06cc \u0642\u0627\u0628\u0644 \u0645\u062d\u0627\u0633\u0628\u0647 \u0627\u0633\u062a.<\/p>\n\n\n\n<p>\u0628\u0631\u0627\u06cc \u0645\u062d\u0627\u0633\u0628\u0647 \u06a9\u0645\u062a\u0631\u06cc\u0646 \u0648 \u0628\u06cc\u0634\u062a\u0631\u06cc\u0646 \u0642\u06cc\u0645\u062a \u0627\u0648\u0644\u06cc\u0647 \u0645\u0645\u06a9\u0646 \u0627\u0632 \u0631\u0648\u0634 <a href=\"https:\/\/fa.wikipedia.org\/wiki\/%D8%A7%D9%84%DA%AF%D9%88%D8%B1%DB%8C%D8%AA%D9%85_%D8%AC%D8%B3%D8%AA%D8%AC%D9%88%DB%8C_%D8%AF%D9%88%D8%AF%D9%88%DB%8C%DB%8C\">\u062c\u0633\u062a\u0648\u062c\u0648\u06cc \u062f\u0648\u062f\u0648\u06cc\u06cc<\/a> \u06a9\u0645\u06a9 \u0645\u06cc\u200c\u06af\u06cc\u0631\u06cc\u0645. \u0647\u0631 \u0628\u0627\u0631 \u0641\u0631\u0636 \u0645\u06cc\u200c\u06a9\u0646\u06cc\u0645 \u0627\u06af\u0631 \u0642\u06cc\u0645\u062a \u0627\u0648\u0644\u06cc\u0647 <span class=\"katex-eq\" data-katex-display=\"false\">x<\/span> \u0628\u0627\u0634\u062f\u060c \u0642\u06cc\u0645\u062a \u0646\u0647\u0627\u06cc\u06cc \u0628\u06cc\u0634\u062a\u0631 \u0627\u0632 <span class=\"katex-eq\" data-katex-display=\"false\">p<\/span> \u0627\u0633\u062a \u06cc\u0627 \u06a9\u0645\u062a\u0631 \u0627\u0632 \u0622\u0646 \u0648 \u0628\u062f\u06cc\u0646 \u0637\u0631\u06cc\u0642 \u06a9\u0645\u06cc\u0646\u0647 \u0648 \u0628\u06cc\u0634\u06cc\u0646\u0647 \u0645\u0642\u062f\u0627\u0631 \u0627\u0648\u0644\u06cc\u0647 \u0645\u0645\u06a9\u0646 \u0631\u0627 \u0645\u06cc\u200c\u06cc\u0627\u0628\u06cc\u0645.<\/p>\n\n\n\n<p>\u067e\u06cc\u0686\u06cc\u062f\u06af\u06cc \u0632\u0645\u0627\u0646\u06cc:<\/p>\n\n\n\n<div class=\"wp-block-katex-display-block katex-eq\" data-katex-display=\"true\"><pre>\\mathcal{O}(T \\times N \\times \\log(P))<\/pre><\/div>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"cpp\" class=\"language-cpp line-numbers\">#include &lt;bits\/stdc++.h&gt;\n\nusing namespace std;\n\ntypedef long long ll;\n\nll n, p, b, d;\nvector&lt;ll&gt; rate;\n\ninline ll round(double x, ll b)\n{\n\tif(fmod(x,b)*2 &gt;= b)\n\t\treturn x-fmod(x,b)+b+0.00001;\n\treturn x-fmod(x,b)+0.00001;\n}\n\ninline ll after(ll x, ll cnt = n)\n{\n\tfor(int i = 0; i &lt; cnt; i++)\n\t\tif(rate[i+1] &gt; rate[i])\n\t\t\tx = round(1.00*x*rate[i+1]\/rate[i],b);\n\treturn x;\n}\n\ninline ll Low()\n{\n\tll mid, l = 0, r = 5000000;\n\twhile(l+1 &lt; r)\n\t{\n\t\tmid = (l+r)\/2;\n\t\tif(after(mid) &gt;= p)r = mid;\n\t\telse l = mid;\n\t}\n\treturn r;\n}\n\ninline ll Upp()\n{\n\tll mid, l = 0, r = 5000000;\n\twhile(l+1 &lt; r)\n\t{\n\t\tmid = (l+r)\/2;\n\t\tif(after(mid) &lt;= p)l = mid;\n\t\telse r = mid;\n\t}\n\treturn l;\n}\n\nint main()\n{\n\tios_base::sync_with_stdio(false); cin.tie(0);\n\t\n\twhile(true)\n\t{\n\t\tcin &gt;&gt; n &gt;&gt; p &gt;&gt; b &gt;&gt; d;\n\t\tif(max(max(n,p),max(b,d)) == 0)\n\t\t\tbreak;\n\t\trate.resize(n+1);\n\t\tfor(auto &amp;u: rate)\n\t\t\tcin &gt;&gt; u;\n\t\tll l = Low(), r = Upp();\n\t\tcout &lt;&lt; after(l,n-d) &lt;&lt; ' ' &lt;&lt; after(r,n-d) &lt;&lt; '\\n';\n\t}\n\t\n\treturn 0;\n}<\/code><\/pre>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"has-medium-font-size wp-block-heading\" id=\"h-i-jungle-of-coconuts\"><span class=\"ez-toc-section\" id=\"I_%E2%80%93_Jungle_of_Coconuts\"><\/span><a href=\"https:\/\/quera.org\/problemset\/171793\/\"><strong>I \u2013 Jungle of Coconuts<\/strong><\/a><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u06af\u0631\u0627\u0641\u06cc \u0627\u0632 \u0631\u0648\u06cc \u062c\u062f\u0648\u0644 \u0645\u06cc\u200c\u0633\u0627\u0632\u06cc\u0645 \u0628\u0647\u200c\u0637\u0648\u0631\u06cc \u06a9\u0647 \u0631\u0623\u0633\u200c\u0647\u0627\u06cc \u0622\u0646 \u062e\u0627\u0646\u0647\u200c\u0647\u0627\u06cc \u062e\u0627\u0644\u06cc (\u0634\u0627\u0645\u0644 \u062a\u0648\u0646\u0644) \u0628\u0627\u0634\u0646\u062f \u0648 \u06cc\u0627\u0644\u200c\u0647\u0627 \u0628\u06cc\u0646 \u062e\u0627\u0646\u0647\u200c\u0647\u0627\u06cc \u0645\u062c\u0627\u0648\u0631 \u0648 \u0633\u067e\u0633 \u0628\u0627 \u0627\u0644\u06af\u0648\u0631\u06cc\u062a\u0645 <a href=\"http:\/\/www.algorithmha.ir\/%D8%AC%D8%B3%D8%AA%D8%AC%D9%88%DB%8C-%D8%A7%D9%88%D9%84-%D8%B3%D8%B7%D8%AD-bfs\/\">\u062c\u0633\u062a\u200c\u0648\u200c\u062c\u0648 \u0627\u0648\u0644 \u0633\u0637\u062d(BFS)<\/a> \u0645\u06cc\u200c\u062a\u0648\u0627\u0646 \u0641\u0627\u0635\u0644\u0647 \u0647\u0631 \u062a\u0648\u0646\u0644 \u0627\u0632 \u0634\u06cc\u0631 \u0648 \u0645\u0647\u0631\u062f\u0627\u062f \u0631\u0627 \u067e\u06cc\u062f\u0627 \u06a9\u0631\u062f. (\u062a\u0648\u062c\u0647 \u06a9\u0646\u06cc\u062f \u06af\u0631\u0627\u0641 \u0634\u06cc\u0631 \u06a9\u0645\u06cc \u0645\u062a\u0641\u0627\u0648\u062a \u0627\u0633\u062a \u0686\u0631\u0627 \u06a9\u0647 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u062f \u0627\u0632 \u0631\u0648\u06cc \u0641\u0646\u0633\u200c\u0647\u0627 \u0628\u067e\u0631\u062f \u0648 \u06cc\u0627\u0644\u200c\u0647\u0627\u06cc \u0628\u06cc\u0634\u062a\u0631\u06cc \u06af\u0631\u0627\u0641\u0634 \u062f\u0627\u0631\u062f.)<\/p>\n\n\n\n<p>\u067e\u06cc\u0686\u06cc\u062f\u06af\u06cc \u0632\u0645\u0627\u0646\u06cc:<\/p>\n\n\n\n<div class=\"wp-block-katex-display-block katex-eq\" data-katex-display=\"true\"><pre>\\mathcal{O}(T \\times N \\times M)<\/pre><\/div>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"cpp\" class=\"language-cpp line-numbers\">#include &lt;bits\/stdc++.h&gt;\nusing namespace std;\n \ntypedef long long ll;\n#define pii pair&lt;int, int&gt; \n#define pB push_back\n#define mP make_pair\n#define X first\n#define Y second\n\nconst int maxn=2*100000+10, MOD=1000*1000*1000+7, INF=1000*1000*1000;\n\npii dir[]={pii(0, 1), pii(1, 0), pii(0, -1), pii(-1, 0)};\n\nstring board[500];\n\nint n, m;\n\nbool inRange(pii cur){\n    return (cur.X&gt;=0 &amp;&amp; cur.X&lt;n &amp;&amp; cur.Y&gt;=0 &amp;&amp; cur.Y&lt;m);\n}\n\nbool canGo(pii cur){\n    if(inRange(cur)){\n    char ch=board[cur.X][cur.Y];\n    if(ch=='M' || ch=='.' || ch=='L' || ch=='O')\n        return true;\n    }\n    return false;\n}\n\npii operator + (const pii a, const pii b){\n    return pii(a.X+b.X, a.Y+b.Y);\n}\n\nint color[555][555];\nint curcolor;\n\nvector &lt;pair&lt;pii, int&gt; &gt; BFS(pii start, bool Mehrdad){\n    queue &lt;pair&lt;pii, int&gt; &gt; Q;\n    Q.push(mP(start, 0));\n    curcolor++;\n    vector &lt;pair &lt;pii,  int&gt; &gt; candid;\n    while(!Q.empty()){\n        pair&lt;pii, int&gt; temp=Q.front();\n        Q.pop();\n        if(board[temp.X.X][temp.X.Y]=='O')\n            candid.pB(temp);\n        for(int i=0;i&lt;4;i++){\n            pii nx(temp.X+dir[i]);\n            int delta=0;\n            if(inRange(nx) &amp;&amp; board[nx.X][nx.Y]=='+' &amp;&amp; !Mehrdad){\n                nx=nx+dir[i];\n                delta++;\n            }\n            if(canGo(nx) &amp;&amp; color[nx.X][nx.Y]!=curcolor){\n                color[nx.X][nx.Y]=curcolor;\n                Q.push(mP(nx, temp.Y+1+delta));\n            }\n        }\n    }\n    return candid;\n}\n\npii getTunnel(vector &lt;pair&lt; pii, int&gt; &gt; M, vector &lt;pair&lt; pii, int&gt; &gt; L){\n    pii ans(INF, INF);\n    for(int i=0;i&lt;M.size();i++){\n        bool flag=false;\n        for(int j=0;j&lt;L.size();j++){\n            if(M[i].X==L[j].X){\n                flag=true;\n                if(M[i].Y&lt;L[j].Y &amp;&amp; M[i].X&lt;ans)\n                    ans=M[i].X;\n                break;\n            }\n        }\n        if(!flag &amp;&amp; M[i].X&lt;ans)\n            ans=M[i].X;\n    }\n    return ans;\n}\n\nint main(){\n    int t, tt=1;\n    cin &gt;&gt; t;\n    while(t--){\n        cin &gt;&gt; n &gt;&gt; m;\n        for(int i=0;i&lt;n;i++)\n            cin &gt;&gt; board[i];\n        pii M, L;\n        for(int i=0;i&lt;n;i++)\n            for(int j=0;j&lt;m;j++)\n                if(board[i][j]=='M')\n                    M=pii(i, j);\n                else if(board[i][j]=='L')\n                    L=pii(i, j);\n        vector &lt;pair &lt;pii, int&gt; &gt; me, li;\n        me=BFS(M, true);\n        li=BFS(L, false);\n        pii ans=getTunnel(me, li);\n        cout &lt;&lt; \"Case \" &lt;&lt; tt++ &lt;&lt; \": \";\n        if(ans.X!=INF)\n            cout &lt;&lt; ans.X+1 &lt;&lt; ' ' &lt;&lt; ans.Y+1 &lt;&lt; endl;\n        else\n            cout &lt;&lt; \"good bye my dear good friend :(\" &lt;&lt; endl;\n    }\n    return 0;\n}<\/code><\/pre>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"has-medium-font-size wp-block-heading\" id=\"h-j-shamir-s-birthday\"><span class=\"ez-toc-section\" id=\"J_%E2%80%93_Shamirs_Birthday\"><\/span><a href=\"https:\/\/quera.org\/problemset\/171794\/\"><strong>J \u2013 Shamir\u2019s Birthday<\/strong><\/a><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u0628\u0627 \u062a\u0648\u062c\u0647 \u0628\u0647 \u0627\u06cc\u0646\u06a9\u0647 \u06af\u0648\u0634\u0647\u200c\u0647\u0627\u06cc \u06a9\u06cc\u06a9 \u0633\u0627\u0639\u062a\u06af\u0631\u062f \u062f\u0627\u062f\u0647 \u0634\u062f\u0647 \u0628\u0631\u0627\u06cc \u0627\u06cc\u0646 \u0633\u0624\u0627\u0644 \u06a9\u0627\u0641\u06cc\u0633\u062a \u06cc\u06a9\u06cc \u06cc\u06a9\u06cc \u0646\u0642\u0627\u0637 \u0631\u0627 \u067e\u06cc\u0645\u0627\u06cc\u0634 \u06a9\u0646\u06cc\u0645 \u0648 \u0628\u0631\u0631\u0633\u06cc \u06a9\u0646\u06cc\u0645 \u06a9\u0647 \u0647\u0631 \u0628\u0627\u0631 \u0628\u0647 \u0631\u0627\u0633\u062a \u067e\u06cc\u0686\u06cc\u062f\u0647\u200c\u0627\u06cc\u0645 \u06cc\u0627 \u0646\u0647 (\u0627\u06af\u0631 \u062d\u062a\u06cc \u06cc\u06a9 \u0645\u0648\u0631\u062f \u0647\u0645 \u0631\u0627\u0633\u062a\u06af\u0631\u062f \u0646\u0628\u0627\u0634\u062f \u06cc\u0639\u0646\u06cc \u06a9\u06cc\u06a9 \u062e\u0648\u0631\u062f\u0647 \u0634\u062f\u0647 \u0627\u0633\u062a!)<\/p>\n\n\n\n<p>\u0628\u0631\u0627\u06cc \u0686\u06a9 \u06a9\u0631\u062f\u0646 \u0627\u06cc\u0646\u06a9\u0647 \u062f\u0648 \u0636\u0644\u0639 \u067e\u0634\u062a \u0647\u0645 \u0631\u0627\u0633\u062a\u06af\u0631\u062f \u0647\u0633\u062a\u0646\u062f \u06cc\u0627 \u0646\u0647 \u0627\u0632 <a href=\"https:\/\/blog.faradars.org\/vectors-cross-product\/#%D8%AC%D9%87%D8%AA_%D8%A8%D8%B1%D8%AF%D8%A7%D8%B1_%D8%AD%D8%A7%D8%B5%D9%84_%D8%A7%D8%B2_%DB%8C%DA%A9_%D8%B6%D8%B1%D8%A8_%D8%AE%D8%A7%D8%B1%D8%AC%DB%8C\">\u0636\u0631\u0628 \u062e\u0627\u0631\u062c\u06cc \u062f\u0648\u0628\u0631\u062f\u0627\u0631 \u0648 \u0642\u0627\u0646\u0648\u0646 \u062f\u0633\u062a \u0631\u0627\u0633\u062a<\/a> \u06a9\u0645\u06a9 \u0645\u06cc\u200c\u06af\u06cc\u0631\u06cc\u0645. \u0628\u0631\u0627\u06cc \u062c\u0632\u0626\u06cc\u0627\u062a \u0628\u06cc\u0634\u062a\u0631 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u06a9\u062f \u0631\u0627\u0647\u200c\u062d\u0644 \u0631\u0627 \u0645\u0648\u0631\u062f \u0628\u0631\u0631\u0633\u06cc \u0642\u0631\u0627\u0631 \u062f\u0647\u06cc\u062f.<\/p>\n\n\n\n<p>\u067e\u06cc\u0686\u06cc\u062f\u06af\u06cc \u0632\u0645\u0627\u0646\u06cc:<\/p>\n\n\n\n<div class=\"wp-block-katex-display-block katex-eq\" data-katex-display=\"true\"><pre>\\mathcal{O}(N \\times M)<\/pre><\/div>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"cpp\" class=\"language-cpp line-numbers\">#include &lt;bits\/stdc++.h&gt;\n\nusing namespace std;\n\ninline int cross(int x1, int y1, int x2, int y2){return x1*y2-x2*y1;}\n\ninline bool clockwise(int x1, int y1, int x2, int y2, int x3, int y3)\n{\n\treturn (cross(x3-x2,y3-y2,x2-x1,y2-y1) &gt; 0);\n}\n\ninline bool eaten()\n{\n\tint M;\n\tcin &gt;&gt; M;\n\tint X[M], Y[M];\n\tfor(int i = 0; i &lt; M; i++)\n\t\tcin &gt;&gt; X[i] &gt;&gt; Y[i];\n\tfor(int i = 0; i &lt; M; i++)\n\t\tif(!clockwise(X[i], Y[i], X[(i+1)%M], Y[(i+1)%M], X[(i+2)%M], Y[(i+2)%M]))\n\t\t\treturn true;\n\treturn false;\n}\n\nint main()\n{\n\tios_base::sync_with_stdio(false); cin.tie(0);\n\tint N;\n\tcin &gt;&gt; N;\n\tfor(int i = 1; i &lt;= N; i++)\n\t\tcout &lt;&lt; \"Case \" &lt;&lt; i &lt;&lt; \": \" &lt;&lt; (eaten()?\"YES\":\"NO\") &lt;&lt; '\\n';\n\t\n\treturn 0;\n}<\/code><\/pre>\n\n\n\n<p>\u0627\u0645\u06cc\u062f\u0648\u0631\u0627\u0645 \u0631\u0627\u0647\u200c\u062d\u0644\u200c\u0647\u0627 \u0645\u0641\u06cc\u062f \u0628\u0648\u062f\u0647 \u0628\u0627\u0634\u0647. \u0627\u06af\u0631 \u067e\u06cc\u0634\u0646\u0647\u0627\u062f \u06cc\u0627 \u0633\u0624\u0627\u0644\u06cc \u062f\u0627\u0634\u062a\u06cc\u0646, \u062d\u062a\u0645\u0627\u064b \u062f\u0631 \u0646\u0638\u0631\u0627\u062a \u0645\u0637\u0631\u062d \u0628\u0641\u0631\u0645\u0627\u06cc\u06cc\u062f. \u0645\u0648\u0641\u0642 \u0648 \u0645\u0624\u06cc\u062f \u0628\u0627\u0634\u06cc\u062f.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0627\u06cc\u0646 \u0645\u0633\u0627\u0628\u0642\u0647 \u062f\u0631 \u0633\u0627\u0644 \u06f2\u06f0\u06f1\u06f3 \u062f\u0631 \u00ab\u062f\u0627\u0646\u0634\u06af\u0627\u0647 \u0634\u0647\u06cc\u062f \u0628\u0647\u0634\u062a\u06cc\u00bb \u0628\u0631\u06af\u0632\u0627\u0631 \u0634\u062f\u0647 \u0627\u0633\u062a. \u062a\u06cc\u0645 \u0637\u0631\u0627\u062d\u0627\u0646 \u0627\u06cc\u0646 \u0645\u0633\u0627\u0628\u0642\u0647 \u00ab\u0627\u0645\u06cc\u0646 \u06a9\u0631\u06cc\u0645\u06cc\u00bb\u060c \u00ab\u0641\u062a\u0627 \u0644\u0648\u0627\u0633\u0627\u0646\u06cc\u00bb\u060c&#8230;<\/p>\n","protected":false},"author":40,"featured_media":42386,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46,50,141],"tags":[],"class_list":["post-42371","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-developer","category-quera-developer","category-contests-and-events"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u0631\u0627\u0647\u200c\u062d\u0644\u200c\u0647\u0627\u06cc \u0645\u0633\u0627\u0628\u0642\u0647 \u0627\u0644\u06af\u0648\u0631\u06cc\u062a\u0645 Newbies 2013-2014 - \u06a9\u0648\u0626\u0631\u0627\u200c\u0628\u0644\u0627\u06af<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/\" \/>\n<meta property=\"og:locale\" content=\"fa_IR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u0631\u0627\u0647\u200c\u062d\u0644\u200c\u0647\u0627\u06cc \u0645\u0633\u0627\u0628\u0642\u0647 \u0627\u0644\u06af\u0648\u0631\u06cc\u062a\u0645 Newbies 2013-2014 - \u06a9\u0648\u0626\u0631\u0627\u200c\u0628\u0644\u0627\u06af\" \/>\n<meta property=\"og:description\" content=\"\u0627\u06cc\u0646 \u0645\u0633\u0627\u0628\u0642\u0647 \u062f\u0631 \u0633\u0627\u0644 \u06f2\u06f0\u06f1\u06f3 \u062f\u0631 \u00ab\u062f\u0627\u0646\u0634\u06af\u0627\u0647 \u0634\u0647\u06cc\u062f \u0628\u0647\u0634\u062a\u06cc\u00bb \u0628\u0631\u06af\u0632\u0627\u0631 \u0634\u062f\u0647 \u0627\u0633\u062a. \u062a\u06cc\u0645 \u0637\u0631\u0627\u062d\u0627\u0646 \u0627\u06cc\u0646 \u0645\u0633\u0627\u0628\u0642\u0647 \u00ab\u0627\u0645\u06cc\u0646 \u06a9\u0631\u06cc\u0645\u06cc\u00bb\u060c \u00ab\u0641\u062a\u0627 \u0644\u0648\u0627\u0633\u0627\u0646\u06cc\u00bb\u060c...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/\" \/>\n<meta property=\"og:site_name\" content=\"\u06a9\u0648\u0626\u0631\u0627\u200c\u0628\u0644\u0627\u06af\" \/>\n<meta property=\"article:published_time\" content=\"2023-02-23T09:26:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-02-23T09:26:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/quera.org\/blog\/wp-content\/uploads\/2023\/02\/Newbies-2013-2014.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"800\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"\u0645\u062d\u0645\u062f\u200c\u067e\u0627\u0631\u0633\u0627 \u0627\u0644\u0647\u06cc\u200c\u0645\u0646\u0634\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u0646\u0648\u0634\u062a\u0647\u200c\u0634\u062f\u0647 \u0628\u062f\u0633\u062a\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u0645\u062d\u0645\u062f\u200c\u067e\u0627\u0631\u0633\u0627 \u0627\u0644\u0647\u06cc\u200c\u0645\u0646\u0634\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u0632\u0645\u0627\u0646 \u062a\u0642\u0631\u06cc\u0628\u06cc \u0628\u0631\u0627\u06cc \u062e\u0648\u0627\u0646\u062f\u0646\" \/>\n\t<meta name=\"twitter:data2\" content=\"12 \u062f\u0642\u06cc\u0642\u0647\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"TechArticle\",\"@id\":\"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/\"},\"author\":{\"name\":\"\u0645\u062d\u0645\u062f\u200c\u067e\u0627\u0631\u0633\u0627 \u0627\u0644\u0647\u06cc\u200c\u0645\u0646\u0634\",\"@id\":\"https:\/\/quera.org\/blog\/#\/schema\/person\/69bae95a0d033ce9132807da69794a26\"},\"headline\":\"\u0631\u0627\u0647\u200c\u062d\u0644\u200c\u0647\u0627\u06cc \u0645\u0633\u0627\u0628\u0642\u0647 \u0627\u0644\u06af\u0648\u0631\u06cc\u062a\u0645 Newbies 2013-2014\",\"datePublished\":\"2023-02-23T09:26:39+00:00\",\"dateModified\":\"2023-02-23T09:26:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/\"},\"wordCount\":123,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/quera.org\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/quera.org\/blog\/wp-content\/uploads\/2023\/02\/Newbies-2013-2014.png\",\"articleSection\":[\"\u062a\u0648\u0633\u0639\u0647\u200c\u062f\u0647\u0646\u062f\u0647\",\"\u0628\u0627 \u06a9\u0648\u0626\u0631\u0627 | \u062a\u0648\u0633\u0639\u0647\u200c\u062f\u0647\u0646\u062f\u0647\",\"\u0645\u0633\u0627\u0628\u0642\u0627\u062a \u0648 \u0631\u0648\u06cc\u062f\u0627\u062f\u0647\u0627\"],\"inLanguage\":\"fa-IR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/\",\"url\":\"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/\",\"name\":\"\u0631\u0627\u0647\u200c\u062d\u0644\u200c\u0647\u0627\u06cc \u0645\u0633\u0627\u0628\u0642\u0647 \u0627\u0644\u06af\u0648\u0631\u06cc\u062a\u0645 Newbies 2013-2014 - \u06a9\u0648\u0626\u0631\u0627\u200c\u0628\u0644\u0627\u06af\",\"isPartOf\":{\"@id\":\"https:\/\/quera.org\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/quera.org\/blog\/wp-content\/uploads\/2023\/02\/Newbies-2013-2014.png\",\"datePublished\":\"2023-02-23T09:26:39+00:00\",\"dateModified\":\"2023-02-23T09:26:42+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/#breadcrumb\"},\"inLanguage\":\"fa-IR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"fa-IR\",\"@id\":\"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/#primaryimage\",\"url\":\"https:\/\/quera.org\/blog\/wp-content\/uploads\/2023\/02\/Newbies-2013-2014.png\",\"contentUrl\":\"https:\/\/quera.org\/blog\/wp-content\/uploads\/2023\/02\/Newbies-2013-2014.png\",\"width\":1200,\"height\":800},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u062e\u0627\u0646\u0647\",\"item\":\"https:\/\/quera.org\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u062a\u0648\u0633\u0639\u0647\u200c\u062f\u0647\u0646\u062f\u0647\",\"item\":\"https:\/\/quera.org\/blog\/category\/developer\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"\u0628\u0627 \u06a9\u0648\u0626\u0631\u0627 | \u062a\u0648\u0633\u0639\u0647\u200c\u062f\u0647\u0646\u062f\u0647\",\"item\":\"https:\/\/quera.org\/blog\/category\/developer\/quera-developer\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"\u0645\u0633\u0627\u0628\u0642\u0627\u062a \u0648 \u0631\u0648\u06cc\u062f\u0627\u062f\u0647\u0627\",\"item\":\"https:\/\/quera.org\/blog\/category\/developer\/quera-developer\/contests-and-events\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"\u0631\u0627\u0647\u200c\u062d\u0644\u200c\u0647\u0627\u06cc \u0645\u0633\u0627\u0628\u0642\u0647 \u0627\u0644\u06af\u0648\u0631\u06cc\u062a\u0645 Newbies 2013-2014\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/quera.org\/blog\/#website\",\"url\":\"https:\/\/quera.org\/blog\/\",\"name\":\"\u06a9\u0648\u0626\u0631\u0627\u200c\u0628\u0644\u0627\u06af\",\"description\":\"\u0647\u0645\u0647\u200c\u0686\u06cc\u0632 \u062f\u0631\u0628\u0627\u0631\u0647 \u062f\u0646\u06cc\u0627\u06cc \u0628\u0631\u0646\u0627\u0645\u0647\u200c\u0646\u0648\u06cc\u0633\u06cc\",\"publisher\":{\"@id\":\"https:\/\/quera.org\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/quera.org\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"fa-IR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/quera.org\/blog\/#organization\",\"name\":\"\u06a9\u0648\u0626\u0631\u0627\",\"url\":\"https:\/\/quera.org\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fa-IR\",\"@id\":\"https:\/\/quera.org\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/quera.org\/blog\/wp-content\/uploads\/2022\/09\/logo-quera22-e1574766184574.png\",\"contentUrl\":\"https:\/\/quera.org\/blog\/wp-content\/uploads\/2022\/09\/logo-quera22-e1574766184574.png\",\"width\":300,\"height\":300,\"caption\":\"\u06a9\u0648\u0626\u0631\u0627\"},\"image\":{\"@id\":\"https:\/\/quera.org\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.instagram.com\/quera.ir\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/quera.org\/blog\/#\/schema\/person\/69bae95a0d033ce9132807da69794a26\",\"name\":\"\u0645\u062d\u0645\u062f\u200c\u067e\u0627\u0631\u0633\u0627 \u0627\u0644\u0647\u06cc\u200c\u0645\u0646\u0634\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fa-IR\",\"@id\":\"https:\/\/quera.org\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/839ad20766454d664ab9242756257aaa96b5daab96407a846f4ab61d8d790bbe?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/839ad20766454d664ab9242756257aaa96b5daab96407a846f4ab61d8d790bbe?s=96&d=mm&r=g\",\"caption\":\"\u0645\u062d\u0645\u062f\u200c\u067e\u0627\u0631\u0633\u0627 \u0627\u0644\u0647\u06cc\u200c\u0645\u0646\u0634\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u0631\u0627\u0647\u200c\u062d\u0644\u200c\u0647\u0627\u06cc \u0645\u0633\u0627\u0628\u0642\u0647 \u0627\u0644\u06af\u0648\u0631\u06cc\u062a\u0645 Newbies 2013-2014 - \u06a9\u0648\u0626\u0631\u0627\u200c\u0628\u0644\u0627\u06af","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/","og_locale":"fa_IR","og_type":"article","og_title":"\u0631\u0627\u0647\u200c\u062d\u0644\u200c\u0647\u0627\u06cc \u0645\u0633\u0627\u0628\u0642\u0647 \u0627\u0644\u06af\u0648\u0631\u06cc\u062a\u0645 Newbies 2013-2014 - \u06a9\u0648\u0626\u0631\u0627\u200c\u0628\u0644\u0627\u06af","og_description":"\u0627\u06cc\u0646 \u0645\u0633\u0627\u0628\u0642\u0647 \u062f\u0631 \u0633\u0627\u0644 \u06f2\u06f0\u06f1\u06f3 \u062f\u0631 \u00ab\u062f\u0627\u0646\u0634\u06af\u0627\u0647 \u0634\u0647\u06cc\u062f \u0628\u0647\u0634\u062a\u06cc\u00bb \u0628\u0631\u06af\u0632\u0627\u0631 \u0634\u062f\u0647 \u0627\u0633\u062a. \u062a\u06cc\u0645 \u0637\u0631\u0627\u062d\u0627\u0646 \u0627\u06cc\u0646 \u0645\u0633\u0627\u0628\u0642\u0647 \u00ab\u0627\u0645\u06cc\u0646 \u06a9\u0631\u06cc\u0645\u06cc\u00bb\u060c \u00ab\u0641\u062a\u0627 \u0644\u0648\u0627\u0633\u0627\u0646\u06cc\u00bb\u060c...","og_url":"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/","og_site_name":"\u06a9\u0648\u0626\u0631\u0627\u200c\u0628\u0644\u0627\u06af","article_published_time":"2023-02-23T09:26:39+00:00","article_modified_time":"2023-02-23T09:26:42+00:00","og_image":[{"width":1200,"height":800,"url":"https:\/\/quera.org\/blog\/wp-content\/uploads\/2023\/02\/Newbies-2013-2014.png","type":"image\/png"}],"author":"\u0645\u062d\u0645\u062f\u200c\u067e\u0627\u0631\u0633\u0627 \u0627\u0644\u0647\u06cc\u200c\u0645\u0646\u0634","twitter_card":"summary_large_image","twitter_misc":{"\u0646\u0648\u0634\u062a\u0647\u200c\u0634\u062f\u0647 \u0628\u062f\u0633\u062a":"\u0645\u062d\u0645\u062f\u200c\u067e\u0627\u0631\u0633\u0627 \u0627\u0644\u0647\u06cc\u200c\u0645\u0646\u0634","\u0632\u0645\u0627\u0646 \u062a\u0642\u0631\u06cc\u0628\u06cc \u0628\u0631\u0627\u06cc \u062e\u0648\u0627\u0646\u062f\u0646":"12 \u062f\u0642\u06cc\u0642\u0647"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"TechArticle","@id":"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/#article","isPartOf":{"@id":"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/"},"author":{"name":"\u0645\u062d\u0645\u062f\u200c\u067e\u0627\u0631\u0633\u0627 \u0627\u0644\u0647\u06cc\u200c\u0645\u0646\u0634","@id":"https:\/\/quera.org\/blog\/#\/schema\/person\/69bae95a0d033ce9132807da69794a26"},"headline":"\u0631\u0627\u0647\u200c\u062d\u0644\u200c\u0647\u0627\u06cc \u0645\u0633\u0627\u0628\u0642\u0647 \u0627\u0644\u06af\u0648\u0631\u06cc\u062a\u0645 Newbies 2013-2014","datePublished":"2023-02-23T09:26:39+00:00","dateModified":"2023-02-23T09:26:42+00:00","mainEntityOfPage":{"@id":"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/"},"wordCount":123,"commentCount":0,"publisher":{"@id":"https:\/\/quera.org\/blog\/#organization"},"image":{"@id":"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/#primaryimage"},"thumbnailUrl":"https:\/\/quera.org\/blog\/wp-content\/uploads\/2023\/02\/Newbies-2013-2014.png","articleSection":["\u062a\u0648\u0633\u0639\u0647\u200c\u062f\u0647\u0646\u062f\u0647","\u0628\u0627 \u06a9\u0648\u0626\u0631\u0627 | \u062a\u0648\u0633\u0639\u0647\u200c\u062f\u0647\u0646\u062f\u0647","\u0645\u0633\u0627\u0628\u0642\u0627\u062a \u0648 \u0631\u0648\u06cc\u062f\u0627\u062f\u0647\u0627"],"inLanguage":"fa-IR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/","url":"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/","name":"\u0631\u0627\u0647\u200c\u062d\u0644\u200c\u0647\u0627\u06cc \u0645\u0633\u0627\u0628\u0642\u0647 \u0627\u0644\u06af\u0648\u0631\u06cc\u062a\u0645 Newbies 2013-2014 - \u06a9\u0648\u0626\u0631\u0627\u200c\u0628\u0644\u0627\u06af","isPartOf":{"@id":"https:\/\/quera.org\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/#primaryimage"},"image":{"@id":"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/#primaryimage"},"thumbnailUrl":"https:\/\/quera.org\/blog\/wp-content\/uploads\/2023\/02\/Newbies-2013-2014.png","datePublished":"2023-02-23T09:26:39+00:00","dateModified":"2023-02-23T09:26:42+00:00","breadcrumb":{"@id":"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/#breadcrumb"},"inLanguage":"fa-IR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/"]}]},{"@type":"ImageObject","inLanguage":"fa-IR","@id":"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/#primaryimage","url":"https:\/\/quera.org\/blog\/wp-content\/uploads\/2023\/02\/Newbies-2013-2014.png","contentUrl":"https:\/\/quera.org\/blog\/wp-content\/uploads\/2023\/02\/Newbies-2013-2014.png","width":1200,"height":800},{"@type":"BreadcrumbList","@id":"https:\/\/quera.org\/blog\/newbies-2013-2014-solutions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u062e\u0627\u0646\u0647","item":"https:\/\/quera.org\/blog\/"},{"@type":"ListItem","position":2,"name":"\u062a\u0648\u0633\u0639\u0647\u200c\u062f\u0647\u0646\u062f\u0647","item":"https:\/\/quera.org\/blog\/category\/developer\/"},{"@type":"ListItem","position":3,"name":"\u0628\u0627 \u06a9\u0648\u0626\u0631\u0627 | \u062a\u0648\u0633\u0639\u0647\u200c\u062f\u0647\u0646\u062f\u0647","item":"https:\/\/quera.org\/blog\/category\/developer\/quera-developer\/"},{"@type":"ListItem","position":4,"name":"\u0645\u0633\u0627\u0628\u0642\u0627\u062a \u0648 \u0631\u0648\u06cc\u062f\u0627\u062f\u0647\u0627","item":"https:\/\/quera.org\/blog\/category\/developer\/quera-developer\/contests-and-events\/"},{"@type":"ListItem","position":5,"name":"\u0631\u0627\u0647\u200c\u062d\u0644\u200c\u0647\u0627\u06cc \u0645\u0633\u0627\u0628\u0642\u0647 \u0627\u0644\u06af\u0648\u0631\u06cc\u062a\u0645 Newbies 2013-2014"}]},{"@type":"WebSite","@id":"https:\/\/quera.org\/blog\/#website","url":"https:\/\/quera.org\/blog\/","name":"\u06a9\u0648\u0626\u0631\u0627\u200c\u0628\u0644\u0627\u06af","description":"\u0647\u0645\u0647\u200c\u0686\u06cc\u0632 \u062f\u0631\u0628\u0627\u0631\u0647 \u062f\u0646\u06cc\u0627\u06cc \u0628\u0631\u0646\u0627\u0645\u0647\u200c\u0646\u0648\u06cc\u0633\u06cc","publisher":{"@id":"https:\/\/quera.org\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/quera.org\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"fa-IR"},{"@type":"Organization","@id":"https:\/\/quera.org\/blog\/#organization","name":"\u06a9\u0648\u0626\u0631\u0627","url":"https:\/\/quera.org\/blog\/","logo":{"@type":"ImageObject","inLanguage":"fa-IR","@id":"https:\/\/quera.org\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/quera.org\/blog\/wp-content\/uploads\/2022\/09\/logo-quera22-e1574766184574.png","contentUrl":"https:\/\/quera.org\/blog\/wp-content\/uploads\/2022\/09\/logo-quera22-e1574766184574.png","width":300,"height":300,"caption":"\u06a9\u0648\u0626\u0631\u0627"},"image":{"@id":"https:\/\/quera.org\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.instagram.com\/quera.ir\/"]},{"@type":"Person","@id":"https:\/\/quera.org\/blog\/#\/schema\/person\/69bae95a0d033ce9132807da69794a26","name":"\u0645\u062d\u0645\u062f\u200c\u067e\u0627\u0631\u0633\u0627 \u0627\u0644\u0647\u06cc\u200c\u0645\u0646\u0634","image":{"@type":"ImageObject","inLanguage":"fa-IR","@id":"https:\/\/quera.org\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/839ad20766454d664ab9242756257aaa96b5daab96407a846f4ab61d8d790bbe?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/839ad20766454d664ab9242756257aaa96b5daab96407a846f4ab61d8d790bbe?s=96&d=mm&r=g","caption":"\u0645\u062d\u0645\u062f\u200c\u067e\u0627\u0631\u0633\u0627 \u0627\u0644\u0647\u06cc\u200c\u0645\u0646\u0634"}}]}},"_links":{"self":[{"href":"https:\/\/quera.org\/blog\/wp-json\/wp\/v2\/posts\/42371","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/quera.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/quera.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/quera.org\/blog\/wp-json\/wp\/v2\/users\/40"}],"replies":[{"embeddable":true,"href":"https:\/\/quera.org\/blog\/wp-json\/wp\/v2\/comments?post=42371"}],"version-history":[{"count":23,"href":"https:\/\/quera.org\/blog\/wp-json\/wp\/v2\/posts\/42371\/revisions"}],"predecessor-version":[{"id":42413,"href":"https:\/\/quera.org\/blog\/wp-json\/wp\/v2\/posts\/42371\/revisions\/42413"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/quera.org\/blog\/wp-json\/wp\/v2\/media\/42386"}],"wp:attachment":[{"href":"https:\/\/quera.org\/blog\/wp-json\/wp\/v2\/media?parent=42371"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/quera.org\/blog\/wp-json\/wp\/v2\/categories?post=42371"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/quera.org\/blog\/wp-json\/wp\/v2\/tags?post=42371"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}