akhauriyash/Code-Regression huggingface dataset:
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif




#define int long long
#define rng(i,l,r) for(size_t i=(l);i<(r);++i)
#define rep(i,n) rng(i,0,n)
#define gnr(i,l,r) for(size_t i=(r)-1;i>=(l);i--)
#define per(i,b) gnr(i,0,b)
#define ALL(obj) (obj).begin(), (obj).end()   //1,2,3,...
#define rALL(obj) (obj).rbegin(), (obj).rend()//...,3,2,1

using namespace std;
//using ll = long long;


const int MOD = 1000000007;
const int INF = 1e18;

const int dx4[4] = {1, 0, -1, 0};
const int dy4[4] = {0, 1, 0, -1};
const int dx8[8] = {1,1,0,-1,-1,-1,0,1};
const int dy8[8] = {0,1,1,1,0,-1,-1,-1};

const double pi = acos(-1);



template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }


using Graph = vector<vector<int>>;
int gcd(int a,int b){return b?gcd(b,a%b):a;}
//*max_element(ALL(vector))
//count(ALL(vector),num) -> n




void solve(){
    
    // remove the bottom 3 lines when you submit this code.
    std::ifstream in("sample.txt");
    std::cin.rdbuf(in.rdbuf());

    cin.tie(0);
    ios::sync_with_stdio(false);

    int n; cin >> n;
    vector<int> A(n);
    vector<int> B(n);
    rep(i,n) {
        cin >> A[i];
        B[i] = A[i];
    }
    
    sort(rALL(B));
    
    int max1 = B[0];
    int max2 = B[1];
    
    rep(i,n){
        int ans = 0;
        if(A[i]==max1) ans = max2;
        else ans = max1;
        cout << ans << endl;
    }
    
    
    
    
    
    
    
    
    
    
}



signed main() {
    solve();
    return 0;
}



Measured memory_bytes: 4736
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf = 10**10
mod = 10**9 + 7


def main():
    n,x = list(map(int, input().split()))
    a = list(map(int, input().split()))
    r = 0
    for i in range(n-1):
        wa = a[i] + a[i+1]
        if wa <= x:
            continue
        sa = wa - x
        r += sa
        if sa <= a[i+1]:
            a[i+1] -= sa
        else:
            a[i+1] = 0
    return r


print(main())


Measured memory_bytes: 17192
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <math.h>
#include <cmath>
#include <limits.h>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <functional>
#include <stdio.h>
using namespace std;

long long MOD = 1000000007;

int main() {
    
    int ans = 0;
    int N;
    cin >> N;
    vector<int> A(N);
    for ( int i = 0; i < N; i++ ) {
        cin >> A[i];
    }
    
    int i = 0;
    while( i < N ) {        
        if ( A[i] == i+1 ) { ans++; i += 2; }
        else { i++; }
    }
    
    cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 640
#include <iostream>
#include <string>
#include <map>
using namespace std;

int main() {
    int n; cin >> n;
    map<string, int> ma;
    string s;
    for(int i = 0; i < n; ++i) {
        cin >> s;
        ++ma[s];
    }
    int m; cin >> m;
    string t;
    for(int i = 0; i < m; ++i) {
        cin >> t;
        --ma[t];
    }
    
    int max_ma = 0;
    for(auto i = ma.begin(); i != ma.end(); ++i) {
        max_ma = max(max_ma, i->second);
    }
    
    cout << max_ma << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;

using int32 = int_fast32_t;
using int64 = int_fast64_t;

const int32 INF = 1e9;
const int32 MOD = 1e9+7;
const int64 LLINF = 1e18;

#define YES(n) cout << ((n) ? "YES\n" : "NO\n"  )
#define Yes(n) cout << ((n) ? "Yes\n" : "No\n"  )
#define ANS(n) cout << (n) << "\n"
#define REP(i,n) for(int64 i=0;i<(n);++i)
#define FOR(i,a,b) for(int64 i=(a);i<(b);i++)
#define FORR(i,a,b) for(int64 i=(a);i>=(b);i--)
#define ALL(obj) (obj).begin(),(obj).end()
#define pii pair<int32,int32>
#define pll pair<int64,int64>
#define pb(a) push_back(a)
#define mp make_pair

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int32 n;
    cin >> n;
    vector<int32> w(n);
    int32 t = 0;
    int32 l = 0, r = 0;
    REP(i,n){
        cin >> w[i];
        r += w[i];
    }
    int32 ans = INF;
    t = 0;
    while(t < n-1){
        l += w[t];
        r -= w[t];
        ans = min(ans, abs(l-r));
        // cout << t << " " << abs(l-r) << endl;
        t++;
    }
    ANS(ans);
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;

int main(){
    long long a, b, c;
    cin >> a >> b >> c;
    if(c-a-b > 0 && (c - a - b) * (c - a - b) > 4 * a * b) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 256
#!/usr/bin/env python

from sys import stdin, stderr

def main():
   A = map(int, stdin.readline().split())
   A.sort()
   if A[0] == A[2]:
      print('No')
   elif A[0] == A[1] or A[1] == A[2]:
      print('Yes')
   else:
      print('No')

   return 0

if __name__ == '__main__': main()


Measured memory_bytes: 2568
# include <iostream>
# include <algorithm>
#include <array>
# include <cassert>
#include <cctype>
#include <climits>
#include <numeric>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <tuple>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <bitset>
# include <complex>
# include <chrono>
# include <random>
# include <limits.h>
# include <unordered_map>
# include <unordered_set>
# include <deque>
# include <cstdio>
# include <cstring>
#include <stdio.h>
#include<time.h>
#include <stdlib.h>
#include <cstdint>
#include <cfenv>
#include<fstream>
//#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
long long MOD = 1000000000 + 7;
constexpr long long INF = numeric_limits<LL>::max();
const double PI = acos(-1);
#define fir first
#define sec second
#define thi third
#define debug(x) cerr<<#x<<": "<<x<<'\n'
typedef pair<LL, LL> Pll;
typedef pair<double, double> Dll;
typedef pair<LL, pair<LL, LL>> Ppll;
typedef pair<LL, pair<LL, bitset<100001>>> Pbll;
typedef pair<LL, pair<LL, vector<LL>>> Pvll;
typedef pair<LL, LL> Vec2;
struct Tll { LL first, second, third; };
struct Fll { LL first, second, third, fourth; };
typedef pair<LL, Tll> Ptll;
#define rep(i,rept) for(LL i=0;i<rept;i++)
#define Rrep(i,mf) for(LL i=mf-1;i>=0;i--)
LL h, w, n, m, k, t, s, p, q, last, first, cnt,sum, ans , dp, a[400000], b[400000];
string str, ss;
bool f[200][200];
char c;
int di[4][2] = { { 0,1 },{ 1,0 },{ 0,-1 },{ -1,0 } };
struct Edge { LL to, cost; };
struct edge { LL from, to, cost; };
vector<vector<int>>vec;
vector<edge>ed;
vector<LL>v;
map<Pll, LL>ma;
set<LL>st;

void YN(bool f) {
	if (f)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
}
void yn(bool f) {
	if (f)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
}

int main() {
	cin >> n >> m;
	rep(i, n) {
		cin >> a[i];
	}
	rep(i, n) {
		sum = 0;
		for (int j = i; j < n; j++) {
			sum += a[j];
			v.push_back(sum);
		}
	}
	sort(v.begin(), v.end(), [](LL x, LL y) {return x > y; });
	LL v_size = v.size();
	Rrep(i, 41) {
		bool OK = 0;
		cnt = 0;

		rep(j, v_size) {
			if (v[j] >= ((LL)1 << i)) {
				cnt++;
			}
			else {
				break;
			}
		}
		if (cnt >= m) {
			v_size = cnt;
			ans += ((LL)1 << i);
			OK = 1;
		}
		rep(k, v_size) {
			if (v[k] >= ((LL)1 << i)) {
				v[k] -= ((LL)1 << i);
			}
		}
		sort(v.begin(), v.begin() + v_size, [](LL x, LL y) {return x > y; });
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 8432
module Main where

import Control.Applicative
import Control.Monad
import Data.Array.Unboxed
import Data.Array.IArray

main :: IO ()
main = do
    [n, k] <- fmap read . words <$> getLine :: IO [Int]
    xs <- fmap read . words <$> getLine :: IO [Int]
    let ary = listArray (0, n-1) xs :: UArray Int Int
    let f i = let a = ary ! i
                  b = ary ! (i + (k-1))
                  c = min (abs a) (abs b)
                  d = abs (b - a)
              in c + d
    let b = foldr (\i acc -> min (f i) acc) maxBound [0 .. n-k]
    print b

Measured memory_bytes: 36348
#include <iostream>
#include <algorithm>
#define MAX 100
#define INF 9999999

using namespace std;

int s[MAX + 1][MAX + 1];

int main(void){

  int n;
  cin >> n;
  for( int i = 1 ; i <= n ; i++ ){
    for( int j = 1 ; j <= n ; j++ ){
      int in;
      cin >> in;
      // (0,0)から(i,j)までの和を入れる 
      s[i][j] = s[i - 1][j] + s[i][j - 1] - s[i - 1][j - 1] + in;
    }
  }
 
  int res = -INF;

  for( int i = 1 ; i <= n ; i++ ){ // 終点y座標
    for( int j = 1 ; j <= n ; j++ ){ // 終点x座標
      for( int y = 1 ; y <= i ; y++ ){ // 始点y座標
	for( int x = 1 ; x <= j ; x++){ // 始点x座標
	  res = max( res , s[i][j] - s[i][x - 1] - s[y - 1][j] + s[y - 1][x - 1] );
	}
      }
    }
  }
  cout << res << endl;

  return 0;
}

Measured memory_bytes: 1200
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<ll> vl;
typedef vector<string> vs;
const ll mod = 1e9+7;
const ll inf = 1e17;
const int INF = 1e9;
const double PI = acos(-1);
#define fo(i, a, b) for (int i = a; i < b; i++)
#define re(i, n) fo(i, 0, n)
#define pb push_back
#define mp make_pair
#define all(s) s.begin(), s.end()
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { ll g = gcd(a, b); return a / g * b; }
int main()
{
  int k, x;
  cin >> k >> x;

  fo(i, x-k+1, x+k) cout << i << ' ';
  cout << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fst first
#define snd second
#define all(cont) cont.begin(), cont.end()
#define foreach(it, l) for (auto it = l.begin(); it != l.end(); it++)
#define fore(i,a,b) for(int i=a,almo5t=b;i<almo5t;++i)
#define SZ(x) ((int)x.size())
#define EPS 1e-9
#define PI acos(-1)
#define MOD 1000000007
#define FIN std::ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
 
const int N = 0;
 
typedef long long int ll;
 
using namespace std;

 
int main(){
    FIN;
    //freopen("../input.txt", "r", stdin);freopen("../output.txt", "w", stdout);
    int x,n;cin>>x>>n;
    int pos = false;
    set<int> nums;
    fore(i,0,n){
        int val;cin>>val;
        nums.insert(val);
    }
    int ans = 1e9;
    int vans = 1e9;
    fore(i,-1,102){
        if(!nums.count(i)){
            if(abs(x-i)<vans){
                vans = abs(x-i);
                ans = i;
            }
        }
    }
    cout<<ans;
    return 0;
}

// ============== Notes =============== //
// common bugs
// - remove reader 
// - fastio
// - int overflow (especially intermediate expressionns)
// - array bounds (indices bigger than MAXN?, is MAXN correct?)
// - special cases (n=1, graph not connected?)
// - re-initialize efficiently between test cases

Measured memory_bytes: 3688
import java.util.*;
import java.io.*;

public class Main{
    public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] num = new String[2];
        try{
            num = br.readLine().split(" ");
        }catch(Exception e){

        }
        int k = Integer.valueOf(num[0]);
        int x = Integer.valueOf(num[1]);
        int max = x + k;
        for(int i = x - k + 1;i<max;i++){
            System.out.print(i);
            if(i != max - 1){
                System.out.print(" ");
            }
        }
    }
}

Measured memory_bytes: 22868
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <limits>
#include <random>
#include <complex>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <string.h>
#include <iomanip>
using namespace std;
  
#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define RREP(i,n) for(int (i)=(int)(n)-1;i>=0;i--)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
typedef long long ll;

int main() {

    ll X,Y,Z; cin >> X >> Y >> Z;
    X -= Z;
    cout << (X / (Z + Y)) << endl;

    return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            long x = Long.parseLong(sc.next()); // axis
            long k = Long.parseLong(sc.next()); // count
            long d = Long.parseLong(sc.next()); // d

            // calc
            if (d <= Math.abs(x)) {
                long dnum = Math.min((Math.abs(x) / d), k);
                k = k - dnum;
                x = x - ((x >= 0) ? 1 : -1) * dnum * d;
            }
            if (k % 2 == 0) {
                System.out.println(Math.abs(x));
            } else {
                System.out.println(Math.abs(x + ((x > 0) ? -1 : 1) * d));
            }
        }
    }
}

Measured memory_bytes: 35664
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;

int main(){
    ios_base::sync_with_stdio(false), cin.tie(0);
    cout.precision(10);
    cout << fixed;

    ld a, b, h, m;
    cin >> a >> b >> h >> m;
    ld a1 = 2*acosl(-1)/12*h+2*acosl(-1)/60/12*m;
    ld a2 = 2*acosl(-1)/60*m;
    //cout << a1 << " " << a2 << endl;
    cout << sqrtl(a*a+b*b-2*a*b*cos(a1-a2));
    return 0;
}


Measured memory_bytes: 4188
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define all(v) v.begin(), v.end()
typedef long long ll;
typedef pair<int, int> P;
typedef pair<long long, long long> Pll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<long long> vll;
typedef vector<vector<long long>> vvll;
const long long INF = 1LL << 60;
const int INT_INF = 1 << 30;
const double PI = acos(-1.0);

int main() {
    ll n, tmp = 0, diff, size;
    cin >> n;
    rep2(i, 1, 100){
        if (n <= tmp + pow(26, i)){
        diff = n - 1 - tmp;
        size = i;
        break;
        }
        tmp += pow(26, i);
    } 
    tmp = 26;
    vector<char> answer;
    rep(i, size){
        answer.push_back(char('a' + diff % tmp));
        diff /= 26;
    }
    rep(i, size){
        cout << answer.at(size - 1 - i);
    }
    cout << endl;
}


Measured memory_bytes: 4136
#include <bits/stdc++.h>
using namespace std;

using p_int = pair<int, int>;
const int MAX_N = (int) 1e5 + 1;
// const int MAX_N = (int) 5;

int par[MAX_N];
int p_rank[MAX_N];

void init(int n) {
    for (int i = 0; i < n; ++i) {
        par[i] = i;
        p_rank[i] = 0;
    }
}

int find_root(int x) {
    if (par[x] == x) {
        return x;
    } else {
        // update parent
        return par[x] = find_root(par[x]);
    }
}

void unite(int x, int y) {
    int x_root = find_root(x);
    int y_root = find_root(y);
    if (x_root == y_root) return;

    if (p_rank[x_root] < p_rank[y_root]) {
        par[x_root] = y_root;
    } else {
        par[y_root] = x_root;
        if (p_rank[x_root] == p_rank[y_root]) p_rank[x_root]++;
    }
}

int same(int x, int y) {
    return find_root(x) == find_root(y);
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    int N;
    cin >> N;
    init(N + 1);
    int n = N - 1;
    int white = -1;
    int black = -1;
    queue<vector<int>> que;
    while (n || !que.empty()) {
        int u, v, w;
        if (n > 0) {
            cin >> u >> v >> w;
            n--;
        } else {
            vector<int> q;
            q = (que.front());
            u = q[0];
            v = q[1];
            w = q[2];
            que.pop();
        }

        if (w % 2 == 0) {
            unite(u, v);
            if (white == -1) {
                white = u;
            }
        }  else if (black == -1) {
            if (white == -1) {
                white = u;
                black = v;
            } else if (same(white, u)) {
                black = v;
            } else if (same(white, v)) {
                black = u;
            } else {
                que.push({ u, v, w});
            }
        } else /*if (black != -1 && w % 2 == 1)*/ {
            if (same(black, u)) {
                if (white == -1) {
                    white = v;
                } else {
                    unite(white, v);
                }
            } else if (same(black, v)) {
                if (white == -1) {
                    white = u;
                } else {
                    unite(white, u);
                }
            } else if (same(white, u)) {
                unite(black, v);
            } else if (same(white, v)) {
                unite(black, u);
            } else {
                que.push({ u, v, w });
            }
        }
    }

    for (int i = 1; i <= N; ++i) {
        if (same(i, white)) {
            cout << 0 << '\n';
        } else {
            cout << 1 << '\n';
        }
    }

    return 0;
}


Measured memory_bytes: 6528
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>   
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
using namespace std;
#define i64  long long
#define int  long long
 
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
#define MEM_SIZE 10000
#define DEBUG_OUT true
#define ALL(x) (x).begin(),(x).end()
// int DP[MEM_SIZE][MEM_SIZE] = {0};
// int GMEM[MEM_SIZE][MEM_SIZE] = {0};
template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return;std::cout << e << std::endl;}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == false)return;for(const auto& v : vv){ DEBUG(v); } }
template<class T,class X> void DEBUG(X d, T e){if(DEBUG_OUT == false)return;std::cout <<d<<" ";DEBUG(e);};
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }

//CODE
double dx[]{1,-1,0,0},dy[]{0,0,1,-1};
double fn(double t, int mode, vector<vector<int> >& data)
{
  double MIN = INF, MAX = -1;
  for (int i = 0; i < data.size(); i++)
  {
    double X;
    if(mode == 0) X = data[i][0] + dx[data[i][2]]*t;
    else X = data[i][1] + dy[data[i][2]]*t;
  if(i == 0)
  {
    MIN = MAX = X;
  }
  else
  {
    MIN = min(MIN,X);
    MAX = max(MAX,X);
  }
  }
  return MAX - MIN;
}

void solve(void)
{
  int N;
  cin>>N;
  vector<vector<int> > data(N,vector<int>(3));
  for (int i = 0; i < N; i++)
  {
    int X,Y;
    char D;
    cin>>X>>Y>>D;
    data[i][0] = X;
    data[i][1] = Y;
    if(D == 'R') data[i][2] = 0;
    else if(D == 'L') data[i][2] = 1;
    else if(D == 'U') data[i][2] = 2;
    else if(D == 'D') data[i][2] = 3;
  }
  double l = 0,r = 1e15;
  for (int i = 0; i <= 200; i++)
  {
    double l1 = (l + l + r)/3;
    double l2 = (l + r + r)/3;
    if(fn(l1,0,data)*fn(l1,1,data) < fn(l2,0,data)*fn(l2,1,data)) r = l2;
    else l = l1;
    // DEBUG(l);
  }
  cout<<fn(l,0,data)*fn(l,1,data)<<endl;
  
  
  
  return;
}


int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(9);
  solve();
  

 
  return 0;
}


Measured memory_bytes: 5760
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<int, int> Pi;
typedef vector<ll> Vec;
typedef vector<int> Vi;
typedef vector<string> Vs;
typedef vector<vector<ll>> VV;

#define REP(i, a, b) for(ll i=(a); i<(b); i++)
#define rep(i, n) REP(i, 0, n)
const int INF=1e9;
const int MOD=1000000007;
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl;
#define ALL(v) v.begin(), v.end()
#define dbg(x_) cerr << #x_ << ":" << x_ << endl;
#define pb(x) push_back(x)
#define mp(a, b) make_pair(a,b)
#define Each(a,b) for(auto &a :b)
#define REPM(i, mp) for (auto i = mp.begin(); i != mp.end(); ++i)
#define dbgmap(mp) for (auto i = mp.begin(); i != mp.end(); ++i) { cout << i->first <<":"<<i->second << endl;}
#define sum(v) accumulate(ALL(v),0)
#define fi first
#define se second

template<typename T1, typename T2>
ostream &operator<<(ostream &s, const pair<T1, T2> &p) { return s<<"("<<p.first<<", "<<p.second<<")"; }

// vector
template<typename T>
ostream &operator<<(ostream &s, const vector<T> &v) {
    int len=v.size();
    for(int i=0; i<len; ++i) {
        s<<v[i];
        if(i<len-1) s<<"	";
    }
    return s;
}

// 2 dimentional vector
template<typename T>
ostream &operator<<(ostream &s, const vector<vector<T> > &vv) {
    int len=vv.size();
    for(int i=0; i<len; ++i) {
        s<<vv[i]<<endl;
    }
    return s;
}


Vec  convert( Vec v){
    Vec out;
    ll tmp = 0;

    rep(i,v.size()){
        if(i>0&&v[i]==1&&v[i-1]==1){
            tmp++;
        }else if(v[i]==1){
            tmp = 1;
        }else{
            rep(i,tmp){
                out.push_back(tmp);
            }
            out.push_back(0);
            tmp = 0;
        }
    }
    rep(i,tmp){
        out.push_back(tmp);
    }
    return out;
}
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll h,w;
    cin>>h>>w;
    VV map(h,Vec(w));
    VV rmap(w,Vec(h));

    VV result;
    VV result2;
    ll rowmax=0;
    ll colomnmax=0;
    rep(i,h){
        string tmp;
        cin>>tmp;
        rep(j,tmp.length()){
            map[i][j] = tmp[j]==*"#"?0:1;
            rmap[j][i] = tmp[j]==*"#"?0:1;
        }
        result.pb(convert(map[i]));
    }

    rep(i,w){
        result2.pb(convert(rmap[i]));
    }

//    dbg(result);
//    dbg(result2);

    ll ans = 0;

    rep(i,h){
        rep(j,w){
            ans = max(ans,result[i][j]+result2[j][i]-1);
        }
    }

    cout<<ans<<endl;
    return  0;
}


Measured memory_bytes: 127104
#include <bits/stdc++.h>
#define REP(i, a, n) for(ll i=a; i<n; i++)
#define RREP(i, a, n) for(ll i=n-1; i>=a; i--)
typedef long long ll;
const ll mod =1e9+7;
const ll inf =1e18;
using namespace std;

int main() {
    int n;
    set<string> ss;
    string s[101];
    cin>>n;
    REP(i, 0, n){
        cin>>s[i];
        ss.insert(s[i]);
    }

    bool flag=true;
    REP(i, 0, n-1){
        if(s[i][s[i].size()-1] != s[i+1][0]) flag=false;
    }
    if(flag && ss.size()==n) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <stack>
#include <iomanip>
#include <numeric>
#include <string>
#include <cstring>
#include <algorithm>
#include <functional>
#include <cstdlib>
#include <map>
#include <set>
#include <vector>
#include <utility>
#include <queue>
#include <cmath>

#define BEGIN(x) x.begin()
#define END(x) x.end()
#define ALL(x) BEGIN(x), END(x)
#define PAIR make_pair
#define VEC(type) vector<type >
#define endl '\n'

#define FOR(i, A, B) for(auto i = (A);i != (B); i++)
#define FORD(i, A, B) for(auto i = (A);i != (B); i--)

#define READRANGE(begin, end) FOR(it, begin, end) cin >> *it
#define READVEC(V) READRANGE(BEGIN(V), END(V))

using namespace std;

typedef long long lint;
typedef pair<int, int> Pii;
typedef pair<int, lint> Pil;
typedef pair<lint, lint> Pll;
typedef pair<lint, int> Pli;

// ---- BEGIN LIBRARY CODE ----
// ---- END LIBRARY CODE ----
void io_init()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
};

int main(int argc, char **argv)
{
    io_init();

    // Actual program code starts here.
    string S;
    cin >> S;
    cout << (S[0] == S[1] || S[1] == S[2] || S[3] == S[2] ? "Bad": "Good");
    cout << "\n";
    return 0;
};


Measured memory_bytes: 256
#include <algorithm>
#include <climits>
#include <cmath>
#include <csignal>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>

using ll = long long;
using namespace std;

void dfs(int cur, vector<vector<int>> &tree, vector<bool> check, int &ans) {
    check.at(cur) = true;
    bool flag = true;
    for (int a : tree.at(cur)) {
        if (!check.at(a)) {
            flag = false;
            break;
        }
    }
    if (flag) {
        flag = true;
        for (bool a : check) {
            if (!a) {
                flag = false;
                break;
            }
        }
        if (flag) {
            ans++;
            return;
        }
    }
    for (int a : tree.at(cur)) {
        if (!check.at(a)) {
            dfs(a, tree, check, ans);
        }
    }
}

int main() {
    int n = 0, m = 0;
    cin >> n >> m;
    vector<pair<int, int>> pass(m);
    for (int i=0; i<m; i++) {
        cin >> pass.at(i).first >> pass.at(i).second;
    }
    vector<vector<int>> tree(n);
    for (int i=0; i<m; i++) {
        tree.at(pass.at(i).first-1).push_back(pass.at(i).second-1);
        tree.at(pass.at(i).second-1).push_back(pass.at(i).first-1);
    }
    vector<bool> check(n, false);
    int ans = 0;
    dfs(0, tree, check, ans);
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
N = int(input())
L = sorted(list(map(int, input().split())))

ans = 0
for i in range(N):
    for j in range(i + 1, N):
        for k in range(j + 1, N):
            if L[i] == L[j] or L[j] == L[k]:
                pass
            elif L[i] + L[j] > L[k]:
                ans += 1
print(ans)


Measured memory_bytes: 9120
#include <bits/stdc++.h>
using namespace std;
#define mkpr make_pair
#define ft first
#define sd second

typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;

template<class T>
inline void read(T &x) {
    x=0; int f=0; char ch=getchar();
    while(!isdigit(ch)) {if(ch=='-') f=1; if(ch==EOF) return; ch=getchar();}
    while(isdigit(ch)) {x=x*10+(ch-'0'); ch=getchar();} if(f) x=-x;
}

/***********************************************************/

const int MAXN=200111;
const double PI=acos(-1);
int a[MAXN], dp[MAXN];
PII b[MAXN];
int n, m, sx, sy, tx, ty, tot, flag1, flag2;

int main() {
    scanf("%d%d%d%d%d", &sx, &sy, &tx, &ty, &n);
    if(sx==tx && tx==ty) {
        puts("0");
        return 0;
    }
    if(sx>tx) {
        sx=1e8-sx;
        tx=1e8-tx;
        flag1=1;
    }
    if(sy>ty) {
        sy=1e8-sy;
        ty=1e8-ty;
        flag2=1;
    }
    for(int i=1, x, y;i<=n;++i) {
        scanf("%d%d", &x, &y);
        if(flag1) x=1e8-x;
        if(flag2) y=1e8-y;
        if(x>=sx && x<=tx && y>=sy && y<=ty) {
            b[++tot]=mkpr(x, y);
        }
        dp[i]=1e9;
    }
    sort(b+1, b+1+tot);
    int mx=0;
    for(int i=1;i<=tot;++i) {
        int pos=upper_bound(dp+1, dp+1+n, b[i].sd)-dp;
        dp[pos]=min(dp[pos], b[i].sd);
        mx=max(mx, pos);
    }
    // cerr<<mx<<endl;
    if(mx==tx-sx+1 || mx==ty-sy+1) {
        printf("%.15f\n", 100.*(tx-sx+ty-sy)+(mx-1)*(5.*PI-20.)+10.*PI-20.);
    } else {
        printf("%.15f\n", 100.*(tx-sx+ty-sy)+mx*(5.*PI-20.));
    }
    return 0;
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll inf = 1e18;
const int maxn = 1e5 + 5;
const int maxm = 1<<13;
int cnt[maxn];
ll dp[maxn];
int main() {
	int n, m, a, b, x;
	for (int i = 0; i <= maxm; i++) dp[i] = inf;
	dp[0] = 0;
	scanf("%d%d", &n, &m);
	for (int i = 1; i <= m; i++) {
		scanf("%d%d", &a, &b);
		for (int j = 0; j <= n; j++) cnt[j] = 0;
		for (int j = 1; j <= b; j++) {
			scanf("%d", &x);
			cnt[x] = 1;
		}
		int y = 0;
		for (int j = 0; j <= n; j++) {
			if (cnt[j]) {
				y += 1<<(j - 1);
			}
		}
		for (int j = 0; j <= maxm; j++) {
			dp[j | y] = min(dp[j | y], dp[j] + a);
		}
	}
	if (dp[(1<<n) - 1] >= inf) {
		cout << "-1" << endl; 
	} else {
		cout << dp[(1<<n) - 1] << endl;
	}
	
	return 0;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
#define rep(i,j,n) for(int i=(j);i<(n);i++)
#define per(i,n,j) for(int i=(n)-1;i>=(j);i--)
using ll=long long;
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const ll INF=1LL<<60;

string s;
vector<int> a(1000010);

int main(){
    cin>>s;
    int n=s.size();
    rep(i,0,n+1) if(s[i]=='<') chmax(a[i+1],a[i]+1);
    per (i,n+1,0) if(s[i]=='>') chmax(a[i],a[i+1]+1);
    ll ans=0;
    rep(i,0,n+1) ans+=a[i];
    cout<<ans<<"\n";
    return 0;
}

Measured memory_bytes: 8144
#include <bits/stdc++.h>
using namespace std;

int main() {
  int x;
  cin >> x;
  int y = x;
  int f = 0;
  
  while (x > 0) {
    f += x % 10;
    x /= 10;
  }
  
  if ( (y % f) == 0) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
int main(){
    
    lli n;
    cin >> n;
    vector <lli> dp(3);
    cin >> dp[0] >> dp[1] >> dp[2];
    lli x,y,z;
    for(int i =1;i<n;i++){
            lli prevx = dp[0],prevy=dp[1],prevz = dp[2];
        //cout << dp[0] << " " << dp[1] << " " << dp[2] <<endl;
        cin >> x >> y >> z;
    //cout << x << " "  << y << " " << z <<endl;
        dp[0] = x + max(dp[1],dp[2]);
        dp[1] = y + max(prevx,prevz);
        dp[2] = z + max(prevy,prevx);
    }
    //cout << dp[0] << " " << dp[1] << " " << dp[2] <<endl;
    cout << max(dp[0],max(dp[1],dp[2])) << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0;i<(int)(n);i++)

int main(){
    ll k;
    cin>>k;
    ll p[100]={};
    ll n[300005]={};
    REP(i,9)n[i]=i+1;
    p[0]=0;p[1]=9;
    ll np=1;
    ll now=9;
    while(1==1){
        ll begin=p[np-1];
        ll end=p[np];
        for(ll i=begin;i<end;i++){
            ll nnn=n[i];
            if(nnn%10!=0){
                n[now]=nnn*10+(nnn%10-1); now++;
            }
            n[now]=nnn*10+(nnn%10);now++;
            if(nnn%10!=9){
                n[now]=nnn*10+(nnn%10+1); now++;
            }
            if(now>k)break;
        }
        if(now>k)break;
        np++;
        p[np]=now;
    }
    cout<<n[k-1]<<endl;
}

Measured memory_bytes: 2560
n=int(input())
h=list(map(int,input().split()))
a=0
b=0
i=0
while i<n-1:
    if h[i]>=h[i+1]:
        a+=1
    else:
        b=max(b,a)
        a=0
    i+=1
b=max(b,a)
print(b)

Measured memory_bytes: 63984
#include<stdio.h>
 
int main()
{
  int i,j,n,count=0,v,c,c1,v1;
  int G[101][101],color[101],d[101],pi[101],mincost,ii;
  for(i=0;i<101;i++){
    for(j=0;j<101;j++)G[i][j]=-1;
  }
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d%d",&v,&c);
    for(j=0;j<c;j++){
      scanf("%d%d",&v1,&c1);
      G[v][v1]=c1;
    }
  }
 
  for(i=0;i<n;i++){
    color[i]=0;
    pi[i]=-1;
    d[i]=10000001;
  }
  d[0]=0;
 
  while(1){
    mincost=10000001;
    for(i=0;i<n;i++){
      if(color[i]!=2 && d[i]<mincost){
        mincost=d[i];
        ii=i;
      }
    }
    if(mincost==10000001)break;
    color[ii]=2;
    for(i=0;i<n;i++){
      if(G[ii][i]!=-1 && color[i]!=2 && (G[ii][i]+d[ii])<d[i]){
    pi[i]=ii;
    d[i]=G[ii][i]+d[ii];
    color[i]=1;
      }
    }
  }
  for(i=0;i<n;i++)printf("%d %d\n",i,d[i]);
  return 0;
}


Measured memory_bytes: 2052
#include<cstdio>
int i,j,k,n,m,f[200001];
inline int g(int i)
{
	if(i==f[i])return i;
	return f[i]=g(f[i]);
}
int main()
{
	for(scanf("%d%d",&n,&m);++i<=n+m;f[i]=i);
	for(i=0;++i<=n;)for(scanf("%d",&k);k--;f[g(j+n)]=g(i))scanf("%d",&j);
	for(k=g(n),i=1;i<n;++i)if(g(i)!=k)break;
	if(i<n)puts("NO");else puts("YES");
}

Measured memory_bytes: 1920
#include <bits/stdc++.h>
using namespace std;

const double pi  = 2 * acos(0.0);
const double eps = 1e-8;

#define REP(i,a,b) for(int i=(a); i<(b);++i)
#define rep(i,n) REP(i,0,n)
#define INF (1<<29)
#define INFLL (1L<<62LL)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

typedef int Cost;
struct Edge {
  int src, dst; Cost cost;
  Edge(int s, int d, Cost c) : src(s), dst(d), cost(c) {}
};
typedef vector<Edge>  Edges;
typedef vector<Edges> Graph;
typedef vector<Cost>  Array;
typedef vector<Array> Matrix;

int dx[8] = {0, 1, 0, -1, 1, -1, 1, -1};
int dy[8] = {1, 0, -1, 0, 1, -1, -1, 1};

int main(void) {
  ios_base::sync_with_stdio(false); cin.tie(0);
  int a, b, c;
  cin >> a >> b >> c;
  if (b - a == c - b) cout << "YES" << endl;
  else cout << "NO" << endl;
  return 0;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int m,d;
int main(){
    ll ans=0;
    cin>>m>>d;
    for(int i=1;i<=m;i++){
        for(int j=1;j<=d;j++){
            int d10=j%10;
            int d1=j/10;
            if(d1>=2&&d10>=2&&d1*d10==i){
                ans++;
            }
        }
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<algorithm>
#include<cstring>
#include<cstdio>
#define INF 1<<28
using namespace std;

int sx, sy, gx, gy;
int dx[5][1111], dy[5][1111], dn[5];
int memo[5][5][1111];
int a, b;
int u;

int solve(int k, int t, int q){

  if(k == 4) return abs(dx[t][q]-gx) + abs(dy[t][q]-gy);
  if(memo[k][t][q]) return memo[k][t][q];

  int ans = INF, d = (t+1)%5, s;
  for(int i=0;i<dn[d];i++){
    if(!k) s = abs(sx-dx[d][i]) + abs(sy-dy[d][i]);
    else s = abs(dx[t][q]-dx[d][i]) + abs(dy[t][q]-dy[d][i]);
    ans = min(ans, solve(k+1, d, i) + s);
  }

  return memo[k][t][q] = ans;
}

int main(){

  int w,h;
  char c;

  while(true){
    scanf("%d %d", &w, &h);
    if(!w && !h) break;

    memset(dn, 0, sizeof(dn));

    for(int i=0;i<h;i++){
      for(int j=0;j<w;j++){
	scanf(" %c", &c);
	if(c == 'S') sx = j, sy = i;
	else if(c == 'G') gx = j, gy = i;
	else if(c != '.') u = c-'1', dx[u][dn[u]] = j, dy[u][dn[u]] = i, dn[u]++;
      }
    }
    
    b = INF;
    for(int i=0;i<5;i++){
      memset(memo, 0, sizeof(memo));
      if(b > solve(0,i,0)) a = i, b = memo[0][i][0];
    }

    if(b == INF) printf("NA\n");
    else printf("%d %d\n", a+1, b);

  }
}

Measured memory_bytes: 1188
import java.util.*;
class Main {
	public static void main (String[] args) throws java.lang.Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a[] = new int[n];
		for(int i = 0; i < n; i++) a[i] = sc.nextInt();
		for(int i = 0; i < n; i++) {
			if(i != 0) System.out.print(" ");
			System.out.print(a[n - i - 1]);
		}
		System.out.println();
	}
}



Measured memory_bytes: 26372
#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <tuple>
#include <vector>

using namespace std;
typedef long long int ll;
typedef vector<int> vi;
typedef vector<vi> vvi;

#define INF (1e9)

ll a, b, x;

ll f(ll n, ll x) {
    if (n < 0) return 0;
    return n / x + 1;
}
int main() {
    cin >> a >> b >> x;
    ll ans = f(b, x) - f(a - 1, x);
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,s,n) for(int i = s;i<n;i++)
#define repe(i,s,n) for(int i = s;i<=n;i++)
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
static const ll maxLL = (ll)1 << 62;
const int mod=1000000007;
int dy[]={-1,0,1,0};
int dx[]={0,1,0,-1};


#define int ll


int n,k;

signed main(){
    cin>>n>>k;
    
    int x;
    x=n/k;
    int y=k/2;
    int cnt=1;
    
    if(k%2==1){cout<<x*(x-1)*3+x*(x-1)*(x-2)+x<<endl;
   }else{ cnt=n*2/k-n/k;
    cout<<x*(x-1)*3+x*(x-1)*(x-2)+x+cnt*(cnt-1)*3+cnt*(cnt-1)*(cnt-2)+cnt<<endl;
    }
    
    return 0;
}

Measured memory_bytes: 256
# 60

v, e = map(int, input().split())
dp = [[[float("Inf")] * (v) for x in range(v)] for y in range(v+1)]

for i in range(e):
    s, t, d = map(int, input().split())
    dp[0][s][t] = d

for i in range(v):
    dp[0][i][i] = 0

for k in range(v):
    for i in range(v):
        for j in range(v):
            dp[k+1][i][j] = min(dp[k][i][j], dp[k][i][k] + dp[k][k][j])

for i in range(v):
    if dp[v][i][i] < 0:
        print("NEGATIVE CYCLE")
        break
else:
    for i in range(v):
        print(*[(str(x)).upper() for x in dp[v][i]])


Measured memory_bytes: 21100
#include <iostream>
using namespace std;

int main() {

  while (true) {
    int n, x;
    cin >> n >> x;
    if (n == 0 && x == 0)
      break;

    int count = 0;
    int i, j, k;
    for (i = 1; i <= n - 2; i++) {
      for (j = i + 1; j <= n - 1; j++) {
        for (k = j + 1; k <= n; k++) {
          if (i + j + k == x) {
            // cout << i << " + " << j << " + " << k << " = " << x << endl;
            count++;
          }
        }
      }
    }
    cout << count << endl;
  }
  return 0;
}



Measured memory_bytes: 3080
#include <iostream>
#include <vector>
using namespace std;

int main(){
  string s;
  cin >> s;
  s = "S"+s;
  vector<int> t(s.length());
  int ans = 0;
  for(int i = 1; i < s.length(); ++i){
    if(s[i] == 'S') continue;
    t[i] = t[i-1]+1;
    ans = max(ans,t[i]);
  }
  cout << ans << endl;
}


Measured memory_bytes: 3536
// 169_b.cc
#include <bits/stdc++.h>
using namespace std;

using ll = long long;

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	int n;
	cin >> n;
	ll ans = 1;

	const ll mx = 1LL * 1e18;
	bool wasZero = false, wasOverflow = false;
	for (int i = 0; i < n; i++) {
		ll x; cin >> x;

		// cout << ans <<  " ";
		if (x != 0 && ans != 0 && x > mx / ans) {
			// ans = -1;
			wasOverflow = true;
			// break;
		} else if (x == 0) {
			// ans = 0;
			wasZero = true;
		}

		if (!wasZero && !wasOverflow)
			ans *= x;
		// cout << ans <<  " ";

	}

	if (wasZero) 
		cout << 0 << endl;
	else if (wasOverflow)
		cout << -1 << endl;
	else 
		cout << ans << endl;

}

// 1000000000000000000
// 1000000000000000001

Measured memory_bytes: 3656
#include <bits/stdc++.h>
#include <cassert>
typedef long long int ll;
using namespace std;

#if defined(DEBUG)

#include <unistd.h>
#include <sys/fcntl.h>
#define DLOG(...)        cerr << dbgFormat(__VA_ARGS__) << endl
#define DCALL(func, ...) func(__VA_ARGS__)

template <class... Args>
string dbgFormat(const char* fmt, Args... args) {
  size_t len = snprintf(nullptr, 0, fmt, args...);
  char buf[len + 1];
  snprintf(buf, len + 1, fmt, args...);
  return string(buf);
}

#else  // defined(DEBUG)

#define DLOG(...)
#define DCALL(func, ...)

#endif // defined(DEBUG)

int main(int argc, char *argv[]) {
#if defined(DEBUG)
  // GDB on Cygwin ignores redirection at run command.
  if (argc == 2) dup2(open(argv[1], 0), 0);
#else
  // For performance.  We should not use C-style stdio functions
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
#endif
  cout << setprecision(20);

  int N; cin >> N;
  vector<int> a(N+1);
  for (int i = 1; i <= N; i++)  cin >> a.at(i);
  vector<char> p(N+1);
  int k = 0;
  for (int i = N; i >= 1; i--) {
    char x = a.at(i);
    for (int j = i*2; j <= N; j += i) {
      if (p.at(j)) x = 1 - x;
    }
    p.at(i) = x;
    k += x;
  }
  cout << k << endl;
  bool first = true;
  for (int i = 1; i <= N; i++) {
    if (p.at(i)) {
      if (first) first = false;
      else       cout << " ";
      cout << i;
    }
  }
  if (k > 0)  cout << endl;

  return 0;
}



Measured memory_bytes: 1920
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String[] arr = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l",
     "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"};
    int[] ans = new int[26];
    StringBuilder sb = new StringBuilder();
    while(sc.hasNext()) {
      sb.append(sc.next());
    }
    String s = sb.toString().toLowerCase();
    for(int i = 0; i < s.length(); i++) {
      for(int j = 0; j < 26; j++) {
        if(s.substring(i, i + 1).equals(arr[j])) {
          ans[j]++;
          break;
        }
      }
    }
    for(int i = 0; i < 26; i++) {
      System.out.println(arr[i] + " : " + ans[i]);
    }
  }
}



Measured memory_bytes: 27896
#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
#include <set>
#include <stdio.h>
#include <math.h>
#include <queue>
using namespace std;
typedef long long int lli;
const long long int MaxN=500005;
const lli mod=1e9+7;
#define fst first
#define snd second
#define mp make_pair
const float pi=3.1415926535897932384626433832795028;
	lli mcd(lli a,lli b){
		if(a==0)return b;
		return mcd(b%a,a);
	}
	void solve(){
		lli N,i,j,p,q,res,tot=0;
		cin>>N;
		res=(N*2)/11;		
		tot=res*11;
		if(N%11!=0)res+=1;
		if((N+5)%11==0)res-=1;
		if(N<=6)res=1;
		cout<<res;//<<" "<<tot;
	}
int main(){
	//cin.tie(0),ios_base::sync_with_stdio(0);
	lli i,t;
	t=1;
	for(i=1;i<=t;i++){
		solve();
	}
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

template<int32_t mod>
struct ModInt{
	int32_t a;
	inline int32_t normalize(int64_t x){
		x%=mod;
		if(x<0)x+=mod;
		return x;
	}
	ModInt(const int64_t a=0):a(normalize(a)){}

	ModInt& operator+=(const ModInt &x){
		a+=x.a;
		if(a>=mod)a-=mod;
		return *this;
	}
	ModInt& operator-=(const ModInt &x){
		a-=x.a;
		if(a<0)a+=mod;
		return *this;
	}
	ModInt& operator*=(const ModInt &x){
		a=(int64_t)a*x.a%mod;
		return *this;
	}
	ModInt& operator/=(const ModInt &x){
		*this*=x.inv();
		return *this;
	}

	ModInt operator+(const ModInt x){return ModInt(*this)+=x;}
	ModInt operator-(const ModInt x){return ModInt(*this)-=x;}
	ModInt operator*(const ModInt x){return ModInt(*this)*=x;}
	ModInt operator/(const ModInt x){return ModInt(*this)/=x;}
	bool operator==(const ModInt x){return a==x.a;}
	bool operator!=(const ModInt x){return a!=x.a;}

	ModInt operator-(){return ModInt(0)-ModInt(*this);}
	ModInt pow(int64_t ex)const{
		int64_t x=a;
		int64_t res=1;
		while(ex){
			if(ex&1)res=res*x%mod;
			x=x*x%mod;
			ex>>=1;
		}
		return ModInt(res);
	}
	ModInt inv()const{return pow(mod-2);}
};

template<int32_t mod>
istream& operator>>(istream& in,ModInt<mod>& a){
	return (in>>a.a);
}
template<int32_t mod>
ostream& operator<<(ostream& out,const ModInt<mod>& a){
	return (out<<a.a);
}

/*
C[g]=sum{A[i]*B[j] | gcd(i,j)=g}
time:O(NloglogN)
space:O(N)
*/
template<class M>
vector<M>GCDConvolution(vector<M>A,vector<M>B){
	int m=max(A.size(),B.size());
	A.resize(m);
	B.resize(m);
	
	vector<int>isprime(m,1);
	for(int i=2;i<m;i++){
		if(!isprime[i])continue;
		for(int k=m/i;k>=1;k--){
			isprime[k*i]=false;
			A[k]+=A[k*i];
			B[k]+=B[k*i];
		}
	}
	for(int i=1;i<m;i++){
		A[i]+=A[0];
		B[i]+=B[0];
	}

	for(int i=0;i<m;i++)A[i]*=B[i];

	isprime=vector<int>(m,1);
	for(int i=2;i<m;i++){
		if(!isprime[i])continue;
		for(int k=1;k*i<m;k++){
			isprime[k*i]=false;
			A[k]-=A[k*i];
		}
	}
	for(int i=1;i<m;i++)A[i]-=A[0];
	return A;
}





using mint=ModInt<998244353>;

int N;
int A[222222];

signed main(){
	cin>>N;
	rep(i,N)cin>>A[i];

	vector<mint>X(1000001);
	rep(i,N)X[A[i]]+=A[i];

	X=GCDConvolution(X,X);
	mint ans=0;
	for(int i=1;i<=1000000;i++){
		ans+=X[i]/i;
	}

	rep(i,N)ans-=A[i];
	ans/=2;
	cout<<ans<<endl;	
	return 0;
}

Measured memory_bytes: 29184
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000
bool prime[100010];

void set_prime() {
	prime[0] = 1;
	prime[1] = 1;
	for (int i = 2; i < 1000; i++) {
		int j = 2;
		while (i * j <= 100000) {
			prime[i*j] = 1;
			j++;
		}
	}
}

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    set_prime();
    vector<int> v;
    REP(i, 2, 55555) {
        if (prime[i] == 0 && i % 5 == 1) v.push_back(i);
    }
    int N; cin >> N;
    rep(i, N) {
        if (i != 0) cout << " ";
        cout << v[i];
    }
    cout << endl;


    return 0;
}
// 7+7+7+7+7

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;
typedef long long ll;
using namespace std;
const ll mod=1000000007,mod9=1000000009;
template <class T>inline T lcm(T a,T b){return (a*b/__gcd(a,b));}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    sort(a,a+n);
    if(n>3){
        if(a[n-1]==0){
            cout <<"Yes"<<endl;
        }
        else if(n%3){
            cout << "No"<<endl;
        }
        else{
            if(a[0]==a[n/3-1]&&a[n/3]==a[2*n/3-1]&&a[2*n/3]==a[n-1]&&(a[0]^a[n/3]^a[n-1])==0){
                cout << "Yes"<<endl;
            }
            else{
                cout <<"No"<<endl;
            }
        }
    }
    else{
        if(a[0]^a[1]^a[2]){
            cout << "No"<<endl;
        }
        else{
            cout <<"Yes"<<endl;
        }
    }
    return 0;
}



Measured memory_bytes: 640
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
#include <random>
#include <list>
using namespace std;

typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<int, ll> i_ll;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int u, v; ll w; };

ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

int main() {
	int N; cin >> N;
	vector<int> a(N);
	for (int& x: a) cin >> x;
	int mi = INT_MAX;
	for (int x = -100; x <= 100; x++) {
		int sum = 0;
		for (int& y: a) sum += (x - y) * (x - y);
		mi = min(mi, sum);
	}
	cout << mi << endl;
}


Measured memory_bytes: 764