<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>https://discopal.ispras.ru/index.php?action=history&amp;feed=atom&amp;title=Geome_try%2Fcodechef_KAN13F</id>
		<title>Geome try/codechef KAN13F - История изменений</title>
		<link rel="self" type="application/atom+xml" href="https://discopal.ispras.ru/index.php?action=history&amp;feed=atom&amp;title=Geome_try%2Fcodechef_KAN13F"/>
		<link rel="alternate" type="text/html" href="https://discopal.ispras.ru/index.php?title=Geome_try/codechef_KAN13F&amp;action=history"/>
		<updated>2026-04-19T17:34:24Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.26.4</generator>

	<entry>
		<id>https://discopal.ispras.ru/index.php?title=Geome_try/codechef_KAN13F&amp;diff=21287&amp;oldid=prev</id>
		<title>StasFomin в 12:30, 7 октября 2022</title>
		<link rel="alternate" type="text/html" href="https://discopal.ispras.ru/index.php?title=Geome_try/codechef_KAN13F&amp;diff=21287&amp;oldid=prev"/>
				<updated>2022-10-07T12:30:29Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='ru'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 12:30, 7 октября 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l61&quot; &gt;Строка 61:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 61:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Участник:StasFomin|StasFomin]] 02:39, 19 мая 2022 (UTC): Вы невнимательны и игнорировали и курс и задания. Решения ожидается только на Python.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Участник:StasFomin|StasFomin]] 02:39, 19 мая 2022 (UTC): Вы невнимательны и игнорировали и курс и задания. Решения ожидается только на Python.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{:Практикуемся_В_Алгоритмах}}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{:Практикуемся_В_Алгоритмах}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Категория:Проблемы в решении]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key discopal:diff:version:1.11a:oldid:20685:newid:21287 --&gt;
&lt;/table&gt;</summary>
		<author><name>StasFomin</name></author>	</entry>

	<entry>
		<id>https://discopal.ispras.ru/index.php?title=Geome_try/codechef_KAN13F&amp;diff=20685&amp;oldid=prev</id>
		<title>StasFomin в 02:39, 19 мая 2022</title>
		<link rel="alternate" type="text/html" href="https://discopal.ispras.ru/index.php?title=Geome_try/codechef_KAN13F&amp;diff=20685&amp;oldid=prev"/>
				<updated>2022-05-19T02:39:32Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='ru'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 02:39, 19 мая 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l59&quot; &gt;Строка 59:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 59:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;{{checkme|&lt;/del&gt;[[Участник:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Geome try&lt;/del&gt;|&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Ельчинов Егор&lt;/del&gt;]] &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;21&lt;/del&gt;:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;55&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;14 &lt;/del&gt;мая 2022 (UTC)}}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Участник:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;StasFomin&lt;/ins&gt;|&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;StasFomin&lt;/ins&gt;]] &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;02&lt;/ins&gt;:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;39&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;19 &lt;/ins&gt;мая 2022 (UTC)&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;: Вы невнимательны и игнорировали и курс и задания. Решения ожидается только на Python.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;{{:Практикуемся_В_Алгоритмах&lt;/ins&gt;}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[[Категория:Проблемы в решении]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>StasFomin</name></author>	</entry>

	<entry>
		<id>https://discopal.ispras.ru/index.php?title=Geome_try/codechef_KAN13F&amp;diff=20669&amp;oldid=prev</id>
		<title>Geome try: Новая страница: «Codechef/KAN13F &lt;source lang=&quot;cpp&quot;&gt; #pragma GCC optimize(&quot;Ofast&quot;) #include &lt;bits/stdc++.h&gt;  uint64_t solve(size_t deg, const std::vector&lt;uint64_t&gt;&amp; seq) {…»</title>
		<link rel="alternate" type="text/html" href="https://discopal.ispras.ru/index.php?title=Geome_try/codechef_KAN13F&amp;diff=20669&amp;oldid=prev"/>
				<updated>2022-05-14T21:55:53Z</updated>
		
		<summary type="html">&lt;p&gt;Новая страница: «&lt;a href=&quot;/Permission_denied&quot; title=&quot;Permission denied&quot;&gt;Codechef/KAN13F&lt;/a&gt; &amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt; #pragma GCC optimize(&amp;quot;Ofast&amp;quot;) #include &amp;lt;bits/stdc++.h&amp;gt;  uint64_t solve(size_t deg, const std::vector&amp;lt;uint64_t&amp;gt;&amp;amp; seq) {…»&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Codechef/KAN13F]]&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#pragma GCC optimize(&amp;quot;Ofast&amp;quot;)&lt;br /&gt;
#include &amp;lt;bits/stdc++.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
uint64_t solve(size_t deg, const std::vector&amp;lt;uint64_t&amp;gt;&amp;amp; seq) {&lt;br /&gt;
    uint64_t ans = 0;&lt;br /&gt;
    size_t cnt = seq.size();&lt;br /&gt;
    auto steps = (cnt - 1 + deg - 2) / (deg - 1);&lt;br /&gt;
    std::priority_queue&amp;lt;uint64_t, std::vector&amp;lt;uint64_t&amp;gt;, std::greater&amp;lt;uint64_t&amp;gt;&amp;gt; vals;&lt;br /&gt;
    for (auto val : seq) {&lt;br /&gt;
        vals.push(val);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    size_t curr_deg = deg;&lt;br /&gt;
    for (auto rest_steps = steps, rest_cnt = cnt;&lt;br /&gt;
            rest_steps &amp;gt; 0 &amp;amp;&amp;amp; rest_cnt &amp;gt; 1;&lt;br /&gt;
            rest_cnt -= (curr_deg - 1), --rest_steps) {&lt;br /&gt;
        curr_deg = 2;&lt;br /&gt;
        if (rest_cnt - 2 &amp;gt; (rest_steps - 1) * (deg - 1)) {&lt;br /&gt;
            curr_deg = rest_cnt - (rest_steps - 1) * (deg - 1);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        uint64_t sum = 0;&lt;br /&gt;
        for (size_t i = 0; i &amp;lt; curr_deg &amp;amp;&amp;amp; !vals.empty(); ++i) {&lt;br /&gt;
            sum += vals.top();&lt;br /&gt;
            vals.pop();&lt;br /&gt;
        }&lt;br /&gt;
        ans += sum;&lt;br /&gt;
        vals.push(sum);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return ans;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main() {&lt;br /&gt;
    size_t tests = 0;&lt;br /&gt;
    // std::cin &amp;gt;&amp;gt; tests;&lt;br /&gt;
    scanf(&amp;quot;%llu&amp;quot;, &amp;amp;tests);&lt;br /&gt;
    std::vector&amp;lt;uint64_t&amp;gt; answers(tests);&lt;br /&gt;
    for (auto&amp;amp; ans : answers) {&lt;br /&gt;
        size_t cnt = 0, deg = 0;&lt;br /&gt;
        // std::cin &amp;gt;&amp;gt; cnt &amp;gt;&amp;gt; deg;&lt;br /&gt;
        scanf(&amp;quot;%llu %llu&amp;quot;, &amp;amp;cnt, &amp;amp;deg);&lt;br /&gt;
        std::vector&amp;lt;uint64_t&amp;gt; seq(cnt);&lt;br /&gt;
        for (auto&amp;amp; val : seq) {&lt;br /&gt;
            // std::cin &amp;gt;&amp;gt; val;&lt;br /&gt;
            scanf(&amp;quot;%llu&amp;quot;, &amp;amp;val);&lt;br /&gt;
        }&lt;br /&gt;
        ans = solve(deg, seq);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    for (size_t idx = 0; idx &amp;lt; tests; ++idx) {&lt;br /&gt;
        // std::cout &amp;lt;&amp;lt; &amp;quot;Case &amp;quot; &amp;lt;&amp;lt; idx + 1 &amp;lt;&amp;lt; &amp;quot;: &amp;quot; &amp;lt;&amp;lt; answers[idx] &amp;lt;&amp;lt; '\n';&lt;br /&gt;
        printf(&amp;quot;Case %llu: %llu\n&amp;quot;, idx + 1, answers[idx]);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
{{checkme|[[Участник:Geome try|Ельчинов Егор]] 21:55, 14 мая 2022 (UTC)}}&lt;/div&gt;</summary>
		<author><name>Geome try</name></author>	</entry>

	</feed>