<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.wcipeg.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Convex_hull_trick%2Fcommando.cpp</id>
		<title>Convex hull trick/commando.cpp - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://www.wcipeg.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Convex_hull_trick%2Fcommando.cpp"/>
		<link rel="alternate" type="text/html" href="http://www.wcipeg.com/wiki/index.php?title=Convex_hull_trick/commando.cpp&amp;action=history"/>
		<updated>2026-05-09T12:51:31Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.25.2</generator>

	<entry>
		<id>http://www.wcipeg.com/wiki/index.php?title=Convex_hull_trick/commando.cpp&amp;diff=1963&amp;oldid=prev</id>
		<title>101.60.169.14 at 14:31, 11 March 2016</title>
		<link rel="alternate" type="text/html" href="http://www.wcipeg.com/wiki/index.php?title=Convex_hull_trick/commando.cpp&amp;diff=1963&amp;oldid=prev"/>
				<updated>2016-03-11T14:31:46Z</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;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 14:31, 11 March 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&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;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&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;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&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;// The following code for APIO 2010 &amp;quot;Commando&amp;quot; was contributed &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;in &lt;/del&gt;Haidar Abboud.&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;// The following code for APIO 2010 &amp;quot;Commando&amp;quot; was contributed &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;by &lt;/ins&gt;Haidar Abboud.&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;#include &amp;lt;cstdio&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;#include &amp;lt;cstdio&amp;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;#include &amp;lt;algorithm&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;#include &amp;lt;algorithm&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>101.60.169.14</name></author>	</entry>

	<entry>
		<id>http://www.wcipeg.com/wiki/index.php?title=Convex_hull_trick/commando.cpp&amp;diff=1962&amp;oldid=prev</id>
		<title>101.60.169.14 at 14:29, 11 March 2016</title>
		<link rel="alternate" type="text/html" href="http://www.wcipeg.com/wiki/index.php?title=Convex_hull_trick/commando.cpp&amp;diff=1962&amp;oldid=prev"/>
				<updated>2016-03-11T14:29:44Z</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;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 14:29, 11 March 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&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;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&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;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&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;// The following code for APIO 2010 &amp;quot;Commando&amp;quot; was contributed &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;by &lt;/del&gt;Haidar Abboud.&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;// The following code for APIO 2010 &amp;quot;Commando&amp;quot; was contributed &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;in &lt;/ins&gt;Haidar Abboud.&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;#include &amp;lt;cstdio&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;#include &amp;lt;cstdio&amp;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;#include &amp;lt;algorithm&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;#include &amp;lt;algorithm&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>101.60.169.14</name></author>	</entry>

	<entry>
		<id>http://www.wcipeg.com/wiki/index.php?title=Convex_hull_trick/commando.cpp&amp;diff=1752&amp;oldid=prev</id>
		<title>180.211.180.26 at 10:21, 18 November 2013</title>
		<link rel="alternate" type="text/html" href="http://www.wcipeg.com/wiki/index.php?title=Convex_hull_trick/commando.cpp&amp;diff=1752&amp;oldid=prev"/>
				<updated>2013-11-18T10:21: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;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 10:21, 18 November 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L31&quot; &gt;Line 31:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 31:&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;long long query(long long x)&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;long long query(long long x)&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;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; if (pointer &amp;gt;M.size())&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;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; if (pointer &amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;=&lt;/ins&gt;M.size())&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;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; pointer=M.size()-1;&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;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; pointer=M.size()-1;&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;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; while (pointer&amp;lt;M.size()-1&amp;amp;&amp;amp;&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;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; while (pointer&amp;lt;M.size()-1&amp;amp;&amp;amp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>180.211.180.26</name></author>	</entry>

	<entry>
		<id>http://www.wcipeg.com/wiki/index.php?title=Convex_hull_trick/commando.cpp&amp;diff=1670&amp;oldid=prev</id>
		<title>Brian: Created page with &quot;&lt;syntaxhighlight lang=&quot;cpp&quot;&gt; // The following code for APIO 2010 &quot;Commando&quot; was contributed by Haidar Abboud. #include &lt;cstdio&gt; #include &lt;algorithm&gt; #include &lt;vector&gt; using names...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.wcipeg.com/wiki/index.php?title=Convex_hull_trick/commando.cpp&amp;diff=1670&amp;oldid=prev"/>
				<updated>2012-07-23T21:43:09Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt; // The following code for APIO 2010 &amp;quot;Commando&amp;quot; was contributed by Haidar Abboud. #include &amp;lt;cstdio&amp;gt; #include &amp;lt;algorithm&amp;gt; #include &amp;lt;vector&amp;gt; using names...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// The following code for APIO 2010 &amp;quot;Commando&amp;quot; was contributed by Haidar Abboud.&lt;br /&gt;
#include &amp;lt;cstdio&amp;gt;&lt;br /&gt;
#include &amp;lt;algorithm&amp;gt;&lt;br /&gt;
#include &amp;lt;vector&amp;gt;&lt;br /&gt;
using namespace std;&lt;br /&gt;
 &lt;br /&gt;
const int MAXN = 1000001;&lt;br /&gt;
int N , a , b , c;&lt;br /&gt;
int x[MAXN];&lt;br /&gt;
long long sum[MAXN];&lt;br /&gt;
long long dp[MAXN];&lt;br /&gt;
// The convex hull trick code below was derived from acquire.cpp&lt;br /&gt;
vector &amp;lt;long long&amp;gt; M;&lt;br /&gt;
vector &amp;lt;long long&amp;gt; B;&lt;br /&gt;
bool bad(int l1,int l2,int l3)&lt;br /&gt;
{&lt;br /&gt;
        return (B[l3]-B[l1])*(M[l1]-M[l2])&amp;lt;(B[l2]-B[l1])*(M[l1]-M[l3]);&lt;br /&gt;
}&lt;br /&gt;
void add(long long m,long long b)&lt;br /&gt;
{&lt;br /&gt;
        M.push_back(m);&lt;br /&gt;
        B.push_back(b);&lt;br /&gt;
        while (M.size()&amp;gt;=3&amp;amp;&amp;amp;bad(M.size()-3,M.size()-2,M.size()-1))&lt;br /&gt;
        {&lt;br /&gt;
                M.erase(M.end()-2);&lt;br /&gt;
                B.erase(B.end()-2);&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
int pointer;&lt;br /&gt;
long long query(long long x)&lt;br /&gt;
{&lt;br /&gt;
        if (pointer &amp;gt;M.size())&lt;br /&gt;
                pointer=M.size()-1;&lt;br /&gt;
        while (pointer&amp;lt;M.size()-1&amp;amp;&amp;amp;&lt;br /&gt;
          M[pointer+1]*x+B[pointer+1]&amp;gt;M[pointer]*x+B[pointer])&lt;br /&gt;
                pointer++;&lt;br /&gt;
        return M[pointer]*x+B[pointer];&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
int main(){&lt;br /&gt;
        scanf(&amp;quot;%d&amp;quot; , &amp;amp;N);&lt;br /&gt;
        scanf(&amp;quot;%d %d %d&amp;quot; , &amp;amp;a , &amp;amp;b , &amp;amp;c);&lt;br /&gt;
        for(int n = 1 ; n &amp;lt;= N ; n++){&lt;br /&gt;
                scanf(&amp;quot;%d&amp;quot; , &amp;amp;x[n]);&lt;br /&gt;
                sum[n] = sum[n - 1] + x[n];&lt;br /&gt;
        }&lt;br /&gt;
        dp[1] = a * x[1] * x[1] + b * x[1] + c;&lt;br /&gt;
        add(-2 * a * x[1] , dp[1] + a * x[1] * x[1] - b * x[1]);&lt;br /&gt;
 &lt;br /&gt;
        for(int n = 2 ; n &amp;lt;= N ; n++){&lt;br /&gt;
                dp[n] = a * sum[n] * sum[n] + b * sum[n] + c;&lt;br /&gt;
                dp[n] = max(dp[n] , b * sum[n] + a * sum[n] * sum[n] + c + query(sum[n]));&lt;br /&gt;
                add(-2 * a * sum[n] , dp[n] + a * sum[n] * sum[n] - b * sum[n]);&lt;br /&gt;
        }&lt;br /&gt;
        printf(&amp;quot;%lld\n&amp;quot; , dp[N]);&lt;br /&gt;
        return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Brian</name></author>	</entry>

	</feed>