Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
#define tr(container, it) \
        for (auto it = container.begin(); it != container.end(); it++)
#define scontains(c, x) ((c).find(x) != (c).end())   //O(log n)
#define contains(c, x) (find((c).begin(),(c).end(),x) != (c).end()) //O(n)
#define pll pair<ll,ll>
#define pii pair<int,int>
#define mll map<ll,ll>
#define in(x, a, b)((x)>=a && (x)<=b)
#define  rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define  _for(i, end) for (__typeof(end) i = 0; i < (end); i += 1)
#define all(x) (x).begin(),(x).end()
//#define len(array)  (sizeof(array)/sizeof((array)[0]))
#define endl '\n'
#define what_is(x) cerr << #x << " is " << x << endl;
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
#define mod(x, m) ((((x) % (m)) + (m)) % (m))

void err(istream_iterator<string> it) {}

template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cerr << *it << " = " << a << endl;
    err(++it, args...);
}

const double PI = 2 * acos(.0);
const int INF = 0x3f3f3f3f;
const ll LLINF = 1000000000000000005LL;;
const ll MOD = (ll) (1e9) + 7;
//const ll MOD = (ll) 998244353 ;
const double EPS = 1e-10;

int readint() {
    int x;
    cin >> x;
    return x;
}

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
    std::fill((T *) array, (T *) (array + N), val);
}

template<typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
    for (auto a : v)os << a << " ";
    return os;
}

template<typename T>
ostream &operator<<(ostream &os, const set<T> &v) {
    for (auto a : v)os << a << " ";
    return os;
}

ll power_mod(ll x, ll y, ll p) {
    if (y < 0)return 0;
    ll res = 1;

    x = x % p;

    while (y) {
        if (y & 1)
            res = (res * x) % p;
        y = y >> 1;
        x = (x * x) % p;
    }
    return res;
}

ll power(ll x, ll y) {
    if (y < 0)return 0;
    ll res = 1;
    while (y) {
        if (y & 1)
            res = (res * x);
        y = y >> 1;
        x *= x;
    }
    return res;
}

int fac[7777777];

void init(int MX) {
    fac[0] = 1;
    for (int i = 1; i <= MX; i++)
        fac[i] = fac[i - 1] * i % MOD;
}

// Returns n^(-1) mod p
int modInverse(int n, int p) {
    return power_mod(n, p - 2, p);
}

int comb_mod(int n, int r, int p) {
    if (r == 0)
        return 1;

    return (fac[n] * modInverse(fac[r], p) % p *
            modInverse(fac[n - r], p) % p) % p;
}

int comb(int a, int b) {
    int res = 1;
    rep(i, a + 1, a - b + 1)res *= i, res /= a - i + 1;
    //    rep(i,1,b+1)res /= i;
    return res;
}

bool equal(double a, double b) {
    return std::fabs(a - b) < std::numeric_limits<double>::epsilon();
}

struct UnionFind {
    // par[i]：データiが属する木の親の番号。i == par[i]のとき、データiは木の根ノードである
    vector<int> par;
    // sizes[i]：根ノードiの木に含まれるデータの数。iが根ノードでない場合は無意味な値となる
    vector<int> sizes;

    UnionFind(int n) : par(n), sizes(n, 1) {
        // 最初は全てのデータiがグループiに存在するものとして初期化
        rep(i, 0, n) par[i] = i;
    }

    // データxが属する木の根を得る
    int find(int x) {
        if (x == par[x]) return x;
        return par[x] = find(par[x]);  // 根を張り替えながら再帰的に根ノードを探す
    }

    // 2つのデータx, yが属する木をマージする
    void unite(int x, int y) {
        // データの根ノードを得る
        x = find(x);
        y = find(y);

        // 既に同じ木に属しているならマージしない
        if (x == y) return;

        // xの木がyの木より大きくなるようにする
        if (sizes[x] < sizes[y]) swap(x, y);

        // xがyの親になるように連結する
        par[y] = x;
        sizes[x] += sizes[y];
        // sizes[y] = 0;  // sizes[y]は無意味な値となるので0を入れておいてもよい
    }

    // 2つのデータx, yが属する木が同じならtrueを返す
    bool same(int x, int y) {
        return find(x) == find(y);
    }

    // データxが含まれる木の大きさを返す
    int size(int x) {
        return sizes[find(x)];
    }
};


//fastest
struct cpmFunctor {
    inline bool operator()(const pair<int, int> &p1, const pair<int, int> &p2) {
        return p1.first < p2.first || (p1.first == p2.first && p1.second < p2.second);
    }
};

bool isPrime(int n) {
    // Corner case
    if (n <= 1)
        return false;
    if (n == 2 || n == 3)return true;
    if (n % 2 == 0 || n % 3 == 0)return false;
    // Check from 2 to n-1
    for (int i = 5; i * i <= n; i += 6)
        if (n % i == 0)
            return false;
    for (int i = 7; i * i <= n; i += 6)
        if (n % i == 0)
            return false;

    return true;
}

int lcm(int a, int b) {
    return a / __gcd(a, b) * b;
}




//class Graph{
//    int V;
//    vector<int>* adj;
//
//public:
//    Graph(int V){
//        this->V = V;
//        adj = new vector<int>[V];
//
//    }
//
//    void addEdge(int from, int to){
//        adj[from].push_back(to);
//    }
//
//
//    bool isCyclicUtil(int v, bool visited[], bool *recStack)
//    {
//        if(visited[v] == false)
//        {
//            // Mark the current node as visited and part of recursion stack
//            visited[v] = true;
//            recStack[v] = true;
//
//            // Recur for all the vertices adjacent to this vertex
//            for(auto i = adj[v].begin(); i != adj[v].end(); ++i)
//            {
//                if ( !visited[*i] && isCyclicUtil(*i, visited, recStack) )
//                    return true;
//                else if (recStack[*i])
//                    return true;
//            }
//
//        }
//        recStack[v] = false;  // remove the vertex from recursion stack
//        return false;
//    }
//
//// Returns true if the graph contains a cycle, else false.
//// This function is a variation of DFS() in https://www.geeksforgeeks.org/archives/18212
//    bool isCyclic()
//    {
//        // Mark all the vertices as not visited and not part of recursion
//        // stack
//        bool *visited = new bool[V];
//        bool *recStack = new bool[V];
//        for(int i = 0; i < V; i++)
//        {
//            visited[i] = false;
//            recStack[i] = false;
//        }
//
//        // Call the recursive helper function to detect cycle in different
//        // DFS trees
//        for(int i = 0; i < V; i++)
//            if (isCyclicUtil(i, visited, recStack))
//                return true;
//
//        return false;
//    }
//
//
//};

struct edge {
    int to;
    int cost;
};

class wGraph {
    int V;
    vector<edge> *adj;

public:
    wGraph(int V) {
        this->V = V;
        adj = new vector<edge>[V];
    }

    void addEdge(int from, int to, int cost) {
        adj[from].push_back({to, cost});
    }
};

#define int ll

int N, K;
int A[101010];
int S[101010],SS[101010];
void solve(){
    cin >> N >> K;
    _for(i,N)cin >> A[i];
    ll sum = 0, mi = 1e18, mii = 1e18;
    _for(i,N)sum += max(0,A[i]),S[i+1] = S[i] + max(0, A[i]),SS[i+1] = SS[i] - min(0,A[i]);
    _for(i,N-K+1)mi = min(mi, (ll)S[i+K] - S[i]);
    _for(i,N-K+1)mi = min(mi, (ll)SS[i+K]- SS[i]);
    cout << sum - mi << endl;

}






#undef int

int main() {
#if __MINGW32__
    freopen("../Input.txt", "r", stdin);
    freopen("../Output.txt", "w", stdout);

#endif

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    solve();

}
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
#define tr(container, it) \
        for (auto it = container.begin(); it != container.end(); it++)
#define scontains(c, x) ((c).find(x) != (c).end())   //O(log n)
#define contains(c, x) (find((c).begin(),(c).end(),x) != (c).end()) //O(n)
#define pll pair<ll,ll>
#define pii pair<int,int>
#define mll map<ll,ll>
#define in(x, a, b)((x)>=a && (x)<=b)
#define  rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define  _for(i, end) for (__typeof(end) i = 0; i < (end); i += 1)
#define all(x) (x).begin(),(x).end()
//#define len(array)  (sizeof(array)/sizeof((array)[0]))
#define endl '\n'
#define what_is(x) cerr << #x << " is " << x << endl;
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
#define mod(x, m) ((((x) % (m)) + (m)) % (m))

void err(istream_iterator<string> it) {}

template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cerr << *it << " = " << a << endl;
    err(++it, args...);
}

const double PI = 2 * acos(.0);
const int INF = 0x3f3f3f3f;
const ll LLINF = 1000000000000000005LL;;
const ll MOD = (ll) (1e9) + 7;
//const ll MOD = (ll) 998244353 ;
const double EPS = 1e-10;

int readint() {
    int x;
    cin >> x;
    return x;
}

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
    std::fill((T *) array, (T *) (array + N), val);
}

template<typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
    for (auto a : v)os << a << " ";
    return os;
}

template<typename T>
ostream &operator<<(ostream &os, const set<T> &v) {
    for (auto a : v)os << a << " ";
    return os;
}

ll power_mod(ll x, ll y, ll p) {
    if (y < 0)return 0;
    ll res = 1;

    x = x % p;

    while (y) {
        if (y & 1)
            res = (res * x) % p;
        y = y >> 1;
        x = (x * x) % p;
    }
    return res;
}

ll power(ll x, ll y) {
    if (y < 0)return 0;
    ll res = 1;
    while (y) {
        if (y & 1)
            res = (res * x);
        y = y >> 1;
        x *= x;
    }
    return res;
}

int fac[7777777];

void init(int MX) {
    fac[0] = 1;
    for (int i = 1; i <= MX; i++)
        fac[i] = fac[i - 1] * i % MOD;
}

// Returns n^(-1) mod p
int modInverse(int n, int p) {
    return power_mod(n, p - 2, p);
}

int comb_mod(int n, int r, int p) {
    if (r == 0)
        return 1;

    return (fac[n] * modInverse(fac[r], p) % p *
            modInverse(fac[n - r], p) % p) % p;
}

int comb(int a, int b) {
    int res = 1;
    rep(i, a + 1, a - b + 1)res *= i, res /= a - i + 1;
    //    rep(i,1,b+1)res /= i;
    return res;
}

bool equal(double a, double b) {
    return std::fabs(a - b) < std::numeric_limits<double>::epsilon();
}

struct UnionFind {
    // par[i]：データiが属する木の親の番号。i == par[i]のとき、データiは木の根ノードである
    vector<int> par;
    // sizes[i]：根ノードiの木に含まれるデータの数。iが根ノードでない場合は無意味な値となる
    vector<int> sizes;

    UnionFind(int n) : par(n), sizes(n, 1) {
        // 最初は全てのデータiがグループiに存在するものとして初期化
        rep(i, 0, n) par[i] = i;
    }

    // データxが属する木の根を得る
    int find(int x) {
        if (x == par[x]) return x;
        return par[x] = find(par[x]);  // 根を張り替えながら再帰的に根ノードを探す
    }

    // 2つのデータx, yが属する木をマージする
    void unite(int x, int y) {
        // データの根ノードを得る
        x = find(x);
        y = find(y);

        // 既に同じ木に属しているならマージしない
        if (x == y) return;

        // xの木がyの木より大きくなるようにする
        if (sizes[x] < sizes[y]) swap(x, y);

        // xがyの親になるように連結する
        par[y] = x;
        sizes[x] += sizes[y];
        // sizes[y] = 0;  // sizes[y]は無意味な値となるので0を入れておいてもよい
    }

    // 2つのデータx, yが属する木が同じならtrueを返す
    bool same(int x, int y) {
        return find(x) == find(y);
    }

    // データxが含まれる木の大きさを返す
    int size(int x) {
        return sizes[find(x)];
    }
};


//fastest
struct cpmFunctor {
    inline bool operator()(const pair<int, int> &p1, const pair<int, int> &p2) {
        return p1.first < p2.first || (p1.first == p2.first && p1.second < p2.second);
    }
};

bool isPrime(int n) {
    // Corner case
    if (n <= 1)
        return false;
    if (n == 2 || n == 3)return true;
    if (n % 2 == 0 || n % 3 == 0)return false;
    // Check from 2 to n-1
    for (int i = 5; i * i <= n; i += 6)
        if (n % i == 0)
            return false;
    for (int i = 7; i * i <= n; i += 6)
        if (n % i == 0)
            return false;

    return true;
}

int lcm(int a, int b) {
    return a / __gcd(a, b) * b;
}




//class Graph{
//    int V;
//    vector<int>* adj;
//
//public:
//    Graph(int V){
//        this->V = V;
//        adj = new vector<int>[V];
//
//    }
//
//    void addEdge(int from, int to){
//        adj[from].push_back(to);
//    }
//
//
//    bool isCyclicUtil(int v, bool visited[], bool *recStack)
//    {
//        if(visited[v] == false)
//        {
//            // Mark the current node as visited and part of recursion stack
//            visited[v] = true;
//            recStack[v] = true;
//
//            // Recur for all the vertices adjacent to this vertex
//            for(auto i = adj[v].begin(); i != adj[v].end(); ++i)
//            {
//                if ( !visited[*i] && isCyclicUtil(*i, visited, recStack) )
//                    return true;
//                else if (recStack[*i])
//                    return true;
//            }
//
//        }
//        recStack[v] = false;  // remove the vertex from recursion stack
//        return false;
//    }
//
//// Returns true if the graph contains a cycle, else false.
//// This function is a variation of DFS() in https://www.geeksforgeeks.org/archives/18212
//    bool isCyclic()
//    {
//        // Mark all the vertices as not visited and not part of recursion
//        // stack
//        bool *visited = new bool[V];
//        bool *recStack = new bool[V];
//        for(int i = 0; i < V; i++)
//        {
//            visited[i] = false;
//            recStack[i] = false;
//        }
//
//        // Call the recursive helper function to detect cycle in different
//        // DFS trees
//        for(int i = 0; i < V; i++)
//            if (isCyclicUtil(i, visited, recStack))
//                return true;
//
//        return false;
//    }
//
//
//};

struct edge {
    int to;
    int cost;
};

class wGraph {
    int V;
    vector<edge> *adj;

public:
    wGraph(int V) {
        this->V = V;
        adj = new vector<edge>[V];
    }

    void addEdge(int from, int to, int cost) {
        adj[from].push_back({to, cost});
    }
};

#define int ll

int N, K;
int A[101010];
int S[101010],SS[101010];
void solve(){
    cin >> N >> K;
    _for(i,N)cin >> A[i];
    ll sum = 0, mi = 1e18, mii = 1e18;
    _for(i,N)sum += max(0,A[i]),S[i+1] = S[i] + max(0, A[i]),SS[i+1] = SS[i] - min(0,A[i]);
    _for(i,N-K+1)mi = min(mi, (ll)S[i+K] - S[i]);
    _for(i,N-K+1)mi = min(mi, (ll)SS[i+K]- SS[i]);
    cout << sum - mi << endl;

}






#undef int

int main() {
#if __MINGW32__
    freopen("../Input.txt", "r", stdin);
    freopen("../Output.txt", "w", stdout);

#endif

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    solve();

}


Compiler output:
a.cc: In function 'void solve()':
a.cc:290:24: error: no matching function for call to 'max(int, ll&)'
  290 |     _for(i,N)sum += max(0,A[i]),S[i+1] = S[i] + max(0, A[i]),SS[i+1] = SS[i] - min(0,A[i]);
      |                     ~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:290:24: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
  290 |     _for(i,N)sum += max(0,A[i]),S[i+1] = S[i] + max(0, A[i]),SS[i+1] = SS[i] - min(0,A[i]);
      |                     ~~~^~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:290:24: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
  290 |     _for(i,N)sum += max(0,A[i]),S[i+1] = S[i] + max(0, A[i]),SS[i+1] = SS[i] - min(0,A[i]);
      |                     ~~~^~~~~~~~
a.cc:290:52: error: no matching function for call to 'max(int, ll&)'
  290 |     _for(i,N)sum += max(0,A[i]),S[i+1] = S[i] + max(0, A[i]),SS[i+1] = SS[i] - min(0,A[i]);
      |                                                 ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:290:52: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
  290 |     _for(i,N)sum += max(0,A[i]),S[i+1] = S[i] + max(0, A[i]),SS[i+1] = SS[i] - min(0,A[i]);
      |                                                 ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:290:52: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
  290 |     _for(i,N)sum += max(0,A[i]),S[i+1] = S[i] + max(0, A[i]),SS[i+1] = SS[i] - min(0,A[i]);
      |                                                 ~~~^~~~~~~~~
a.cc:290:83: error: no matching function for call to 'min(int, ll&)'
  290 |     _for(i,N)sum += max(0,A[i]),S[i+1] = S[i] + max(0, A[i]),SS[i+1] = SS[i] - min(0,A[i]);
      |                                                                                ~~~^~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:290:83: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
  290 |     _for(i,N)sum += max(0,A[i]),S[i+1] = S[i] + max(0, A[i]),SS[i+1] = SS[i] - min(0,A[i]);
      |                                                                                ~~~^~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:290:83: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
  290 |     _for(i,N)sum += max(0,A[i]),S[i+1] = S[i] + max(0, A[i]),SS[i+1] = SS[i] - min(0,A[i]);
      |                                                                                ~~~^~~~~~~~
a.cc: At global scope:
a.cc:337:6: error: redefinition of 'void err(std::istream_iterator<std::__cxx11::basic_string<char> >)'
  337 | void err(istream_iterator<string> it) {}
      |      ^~~
a.cc:22:6: note: 'void err(std::istream_iterator<std::__cxx11::basic_string<char> >)' previously defined here
   22 | void err(istream_iterator<string> it) {}
      |      ^~~
a.cc:340:6: error: redefinition of 'template<class T, class ... Args> void err(std::istream_iterator<std::__cxx11::basic_string<char> >, T, Args ...)'
  340 | void err(istream_iterator<string> it, T a, Args... args) {
      |      ^~~
a.cc:25:6: note: 'template<class T, class ... Args> void err(std::istream_iterator<std::__cxx11::basic_string<char> >, T, Args ...)' previously declared here
   25 | void err(istream_iterator<string> it, T a, Args... args) {
      |      ^~~
a.cc:345:14: error: redefinition of 'const double PI'
  345 | const double PI = 2 * acos(.0);
      |              ^~
a.cc:30:14: note: 'const double PI' previously defined here
   30 | const double PI = 2 * acos(.0);
      |              ^~
a.cc:346:11: error: redefinition of 'const int INF'
  346 | const int INF = 0x3f3f3f3f;
      |           ^~~
a.cc:31:11: note: 'const int INF' previously defined here
   31 | const int INF = 0x3f3f3f3f;
      |           ^~~
a.cc:347:10: error: redefinition of 'const ll LLINF'
  347 | const ll LLINF = 1000000000000000005LL;;
      |          ^~~~~
a.cc:32:10: note: 'const ll LLINF' previously defined here
   32 | const ll LLINF = 1000000000000000005LL;;
      |          ^~~~~
a.cc:348:10: error: redefinition of 'const ll MOD'
  348 | const ll MOD = (ll) (1e9) + 7;
      |          ^~~
a.cc:33:10: note: 'const ll MOD' previously defined here
   33 | const ll MOD = (ll) (1e9) + 7;
      |          ^~~
a.cc:350:14: error: redefinition of 'const double EPS'
  350 | const double EPS = 1e-10;
      |              ^~~
a.cc:35:14: note: 'const double EPS' previously defined here
   35 | const double EPS = 1e-10;
      |              ^~~
a.cc:352:5: error: redefinition of 'int readint()'
  352 | int readint() {
      |     ^~~~~~~
a.cc:37:5: note: 'int readint()' previously defined here
   37 | int readint() {
      |     ^~~~~~~
a.cc:359:6: error: redefinition of 'template<class A, long unsigned int N, class T> void Fill(A (&)[N], const T&)'
  359 | void Fill(A (&array)[N], const T &val) {
      |      ^~~~
a.cc:44:6: note: 'template<class A, long unsigned int N, class T> void Fill(A (&)[N], const T&)' previously declared here
   44 | void Fill(A (&array)[N], const T &val) {
      |      ^~~~
a.cc:364:10: error: redefinition of 'template<class T> std::ostream& operator<<(std::ostream&, const std::vector<_Tp>&)'
  364 | ostream &operator<<(ostream &os, const vector<T> &v) {
      |          ^~~~~~~~
a.cc:49:10: note: 'template<class T> std::ostream& operator<<(std::ostream&, const std::vector<_Tp>&)' previously declared here
   49 | ostream &operator<<(ostream &os, const vector<T> &v) {
      |          ^~~~~~~~
a.cc:370:10: error: redefinition of 'template<class T> std::ostream& operator<<(std::ostream&, const std::set<T>&)'
  370 | ostream &operator<<(ostream &os, const set<T> &v) {
      |          ^~~~~~~~
a.cc:55:10: note: 'template<class T> std::ostream& operator<<(std::ostream&, const std::set<T>&)' previously declared here
   55 | ostream &operator<<(ostream &os, const set<T> &v) {
      |          ^~~~~~~~
a.cc:375:4: error: redefinition of 'll power_mod(ll, ll, ll)'
  375 | ll power_mod(ll x, ll y, ll p) {
      |    ^~~~~~~~~
a.cc:60:4: note: 'll power_mod(ll, ll, ll)' previously defined here
   60 | ll power_mod(ll x, ll y, ll p) {
      |    ^~~~~~~~~
a.cc:390:4: error: redefinition of 'll power(ll, ll)'
  390 | ll power(ll x, ll y) {
      |    ^~~~~
a.cc:75:4: note: 'll power(ll, ll)' previously defined here
   75 | ll power(ll x, ll y) {
      |