akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <math.h>
#include <stdlib.h>
#include <vector>
#include <map>
typedef long long unsigned int ll;
using namespace std;

int main() {
    string s;
    int w;
    cin>>s;
    cin>>w;
    for(int i=0;i*w<s.length();i++){
        cout<<s[i*w];
    }
    cout<<endl;
    return 0;
    
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <queue>

using namespace std;

struct node
{
    char s[11];
    int t;
};

int main()
{
    int n,q,t;
    scanf("%d %d",&n,&q);
    queue<node> Q;
    node d;

    while(n--)
    {
        scanf("%s %d",&d.s,&d.t);
        Q.push(d);
    }

    int elaps=0;

    while(!Q.empty())
    {
        d=Q.front();    Q.pop();
        if(d.t<=q)
        {
            elaps+=d.t;
            printf("%s %d\n",d.s,elaps);
        }
        else
        {
            elaps+=q;
            d.t-=q;
            Q.push(d);
        }
    }

    return 0;
}






















Measured memory_bytes: 3680
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define forn(i,n) for(int i=0;i<n;i++)
#define fre(i,a,b) for(int i = a; i < b; i++)
#define sf(n) scanf("%lld", &n)
#define sff(a,b) scanf("%lld %lld", &a, &b)
#define sfff(a,b,c) scanf("%d %d %d", &a, &b, &c)
#define pfn(n) printf("%d\n", n)
#define pfs(n) printf("%d ", n)
#define ff first
#define ss second
#define mem(a,b) memset(a,b,sizeof(a))
#define ll long long int
#define f find
#define ub upper_bound
#define lb lower_bound
#define ld long double
#define in insert
#define bs binary_search  
#define le length()
const ll max_i=1e15;
#define np(s) next_permutation(s.begin(),s.end())
//it gives the lexicographically next string
 ll GCD(ll a,ll b)
    {
        if(b==0)
            return a;
        else return GCD(b,a%b);
    }
int main()
{
  int t=1;
  //cin>>t;
  while(t--)
  {
   int n;
   cin>>n;
   int arr[n];
   for(int i=0;i<n;i++) cin>>arr[i];
  int ans=0,p=1;
  for(int i=1;i<n;i++)
  {
    if(arr[i]<=arr[i-1]) p++;
    else
    {
      ans=max(p,ans);
      p=1;
    }
  }
  ans=max(p,ans);
  cout<<ans-1;
  }
  return 0;
}


Measured memory_bytes: 640
import sys
from collections import deque  # 双方向キュー
from collections import defaultdict  # 初期化済み辞書
from heapq import heapify, heappush, heappop, heappushpop  # プライオリティキュー
from bisect import bisect_left, bisect_right  # 二分探索
#import numpy as np  # 1.8.2
#import scipy  # 0.13.3

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in ss]
ss2nnn = lambda ss: [s2nn(s) for s in ss]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [sys.stdin.readline().rstrip() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main():
    X, A = i2nn()
    if X < A:
        print(0)
    else:
        print(10)

main()


Measured memory_bytes: 38384
use whiteread::parse_line;

fn main() {
    let s: String = parse_line().unwrap();
    let s: Vec<char> = s.chars().collect();
    let mut k = 0;
    let len = s.len();
    let mut idx = 0;

    while idx < len - 2 {
        if s[idx] == s[idx + 1] {
            idx += 3;
            k += 2;
        } else {
            idx += 1;
            k += 1;
        }
    }
    k += match len - idx {
        0 => 0,
        2 if s[idx] != s[idx + 1] => 2,
        _ => 1,
    };
    println!("{}", k);
}


Measured memory_bytes: 3152
#include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <complex>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <bitset>
#include <ctime>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cassert>
#include <cstddef>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <sstream>
#include <fstream>
#include <functional>

using namespace std;
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define RREP(i, a) for(int (i) = (a) - 1; (i) >= 0; (i)--)
#define FORR(i, a, b) for(int (i) = (a) - 1; (i) >= (b); (i)--)
#define DEBUG(C) cerr << #C << " = " << C << endl;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
template<typename T> using VT = vector<T>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) rbegin((a)), rend((a))
#define SORT(a) sort(ALL((a)))
#define RSORT(a) sort(RALL((a)))
#define REVERSE(a) reverse(ALL((a)))
#define MP make_pair
#define FORE(a, b) for (auto &&a : (b))
#define EB emplace_back
#define GREATER(T) T, VT<T> greater<T>
template<typename T> inline bool chmax(T &a, T b){if (a < b){a = b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if (a > b){a = b;return true;}return false;}

const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;

const int MAX = 3333;
int N, T;
PII foods[MAX];
int dp[MAX][MAX];

int main(void) {
    cin >> N >> T;
    REP(i, N) {
        cin >> foods[i].first >> foods[i].second;
    }
    sort(foods, foods + N, [](const PII &l, const PII &r) {
        if (l.first == r.first) return l.second > r.second;
        else return l.first < r.first;
    });

    memset(dp, -1, sizeof(dp));
    dp[0][0] = 0;
    REP(i, N) {
        //DEBUG(foods[i].second)
        REP(j, T + 1) if (dp[i][j] != -1) {
            chmax(dp[i + 1][j], dp[i][j]);
            if (j < T) {
                chmax(dp[i + 1][min(j + foods[i].first, T)], dp[i][j] + foods[i].second);
            }
        }
    }

    int ans = 0;
    REP(i, T + 1) {
        chmax(ans, dp[N][i]);
    }
    cout << ans << endl;
}


Measured memory_bytes: 44156
#include<bits/stdc++.h>
using namespace std;
#define sc scanf
#define pr printf
#define pb push_back
#define ll long long int
int main()
{
    vector<int>v;
    int x,i,a,b,c;
    cin>>a>>b>>c;
    v.pb(a);
    v.pb(b);
    v.pb(c);
    sort(v.begin(),v.end());
    x=(v[2]-v[1])+(v[1]-v[0]);
    cout<<x<<endl;

    return 0;

}

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

#ifdef _MSC_VER
#include <Windows.h>
#else
#include <unistd.h>
#endif

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef pair<int, int> PII;
typedef pair<long, long> PLL;
typedef long long LL;
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(LL i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL MOD=(LL)1e9+7;
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

#define INF 1LL << 50

int main(){
    string S;
    cin>>S;
    REP(i,26){
        char c1='a'+i;
        string s="";
        s+=c1;s+=c1;
        auto pos1=S.find(s);
        if(pos1!=string::npos){
            cout<<pos1+1<<" "<<pos1+2;return 0;
        }
        REP(j,26){
            char c2='a'+j;
            s="";
            s+=c1;s+=c2;s+=c1;
            auto pos2=S.find(s);
            if(pos2!=string::npos){
                cout<<pos2+1<<" "<<pos2+3;return 0;
            }
        }

    }
    cout<<"-1 -1"<<endl;
    return 0;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
int main()
{
    char a[20];
    cin.getline(a,20);
    for(int x=0;x<=20;x++)
    {
        if(a[x]>='a'&&a[x]<='z')
        {
        if(x==6||x==14)
        printf(" ");
        printf("%c",a[x]);
        }
    }
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;typedef vector<ll> vll;
#define fill(a) memset(a, 0, sizeof (a))
#define all(v) (v).begin(),(v).end()
#define sp(k) cout<<setprecision(k)<<fixed;
#define rep(i,a) for(int i=0; i<a;i++)
#define rep1(i,a,b) for(int i=(a);i<=(b);++i)
#define irep(i,b,a) for(int i=(b);i>=(a);--i)
#define minv(v) *min_element(v.begin(),v.end())
#define maxv(v) *max_element(v.begin(),v.end())
#define each(it,s) for(auto it = s.begin(); it != s.end(); ++it)
#define unq(v) sort(all(v)),(v).erase(unique((v).begin(),(v).end()),(v).end())
#define getpos(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define _ios ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define ff first
#define ss second
#define pb push_back
#define sz(x) (int)x.size()

const double pi = acos(-1.0);
const int mod = 1000000007; // (int)1e9+7
const int maxn = 2000100;

int main(){
        _ios;

        ll n,r;
        cin>>n>>r;
        ll res,sum;
        if(n<10){
                res= 100*(10-n);
                cout<<r+res<<endl;
        }
        else {
            cout<<r<<endl;
        }





return 0;
}







Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<vector>
#include<string>
#include<cstring>
#include<functional>
#include<stack>
#include<queue>
#include<iomanip>
#include<map>
#include<limits>
#include<cmath>
#include<algorithm>
#include<bitset>
#include<deque>
#include<utility>
#include<complex>
#include<cstdlib>
#include<set>
#include<cctype>

using namespace std;

#define DBG cerr << '!' << endl;
#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define rep(i,s,g) for(ll (i) = (s);(i) < (g);++i)
#define rrep(i,s,g) for(ll (i) = (s);i >= (g);--(i))
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {for(int W = 0;W < (n);W++)cerr << v[W] << ' ';cerr << endl << endl;}
#define SHOW2d(v,i,j) {for(int aaa = 0;aaa < i;aaa++){for(int bbb = 0;bbb < j;bbb++)cerr << v[aaa][bbb] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(10)

typedef long long ll;
typedef vector<int> iv;
typedef vector<iv> iiv;
typedef vector<string> sv;

int sei[111111];

void f(string s,int a)
{
	if(s == "Male")sei[a] = 1;
	else if(s == "Female")sei[a] = 2;
}
	

int main()
{
	ll n;cin >> n;
	string str;
	ll ub = 0;
	ll tb = n;
	ll mid;
	
	cout << 0 << endl;
	cin >> str;
	
	f(str,0);
	if(sei[0] == 0)return 0;
	
	REP(i,19)
	{
		mid = (ub+tb)/2;
		cout << mid << endl;
		cin >> str;
		f(str,mid);
		
		if(sei[mid] == 0)return 0;
		
		if(mid % 2 == 0)
		{
			if(sei[mid] == sei[0])ub = mid;
			else tb = mid;
		}
		else
		{
			if(sei[mid] != sei[0])ub = mid;
			else tb = mid;
		}
		
	}
	return 0;
}

Measured memory_bytes: 852
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <numeric>
#include <queue>
#include <stack>
#include <map> 
#include <set>
#include <string>
#include <functional>
#include <list>
#include <random>
#include <time.h>
#include <iomanip>
#include <assert.h>
#include <numeric>
#define int long long
#define ll long long
#define double long double
#define mod 1000000007
#define MAXN (int)1e+5 * 2+1
#define LL_MAX 9223372036854775807	//ない環境用
#define LL_HALFMAX 9223372036854775807 / 2	//ない環境用
#define MIN -(9223372036854775807 / 2)
#define INF 9223372036854775807 / 2
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
#define REPS(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define mp make_pair


using namespace std;

std::mt19937 mt((int)time(0));

int dx[4] = { 0, 1, 0, -1 }; // x軸方向への変位
int dy[4] = { 1, 0, -1, 0 }; // y軸方向への変位

using Weight = int;
using Flow = int;
struct Edge {
	int src, dst;
	Weight weight;
	Flow cap;
	Edge() : src(0), dst(0), weight(0) {}
	Edge(int s, int d, Weight w) : src(s), dst(d), weight(w) {}
};
using Edges = std::vector<Edge>;
using Graph = std::vector<Edges>;
using Array = std::vector<Weight>;
using Matrix = std::vector<Array>;

void add_edge(Graph &g, int a, int b, Weight w = 1) {
	g[a].emplace_back(a, b, w);
	g[b].emplace_back(b, a, w);
}
void add_arc(Graph &g, int a, int b, Weight w = 1) { g[a].emplace_back(a, b, w); }

struct uf_tree {
	std::vector<int> parent;
	int __size;
	uf_tree(int size_) : parent(size_, -1), __size(size_) {}
	void unite(int x, int y) {
		if ((x = find(x)) != (y = find(y))) {
			if (parent[y] < parent[x]) std::swap(x, y);
			parent[x] += parent[y];
			parent[y] = x;
			__size--;
		}
	}
	bool is_same(int x, int y) { return find(x) == find(y); }
	int find(int x) { return parent[x] < 0 ? x : parent[x] = find(parent[x]); }
	int size(int x) { return -parent[find(x)]; }
	int size() { return __size; }
};



//!!!問題をちゃんと読む!!!
//!!!問題をちゃんと読め!!!
//!!!問題は読みましたか？!!!



signed main() {
	int r, D, x2000;
	cin >> r >> D >> x2000;
	int mo = x2000;
	rep(i, 10) {
		mo = r * mo - D;
		cout << mo << "\n";
	}



	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int x = Integer.parseInt(sc.next());
        String ans = "";
        if ((x >= 400) && (x <= 599)) {
            ans = "8";
        }
        if ((x >= 600) && (x <= 799)) {
            ans = "7";
        }
        if ((x >= 800) && (x <= 999)) {
            ans = "6";
        }
        if ((x >= 1000) && (x <= 1199)) {
            ans = "5";
        }
        if ((x >= 1200) && (x <= 1399)) {
            ans = "4";
        }
        if ((x >= 1400) && (x <= 1599)) {
            ans = "3";
        }
        if ((x >= 1600) && (x <= 1799)) {
            ans = "2";
        }
        if ((x >= 1800) && (x <= 1999)) {
            ans = "1";
        }

        System.out.println(ans);
        sc.close();
    }

}


Measured memory_bytes: 35592
//#include "bits/stdc++.h"

#include <iostream>
#include <vector>
// #include <map>
// #include <string>
// #include <algorithm>
// #include <numeric>
// #include <limits>

using namespace std;

int main() {
	int r, c;
	cin >> r >> c;
	vector<vector<int>> sp;
	for (int i = 0; i < r; i++) {
		vector<int> v_tmp;
		int sum = 0;
		for (int j = 0; j < c; j++) {
			int tmp;
			cin >> tmp;
			sum += tmp;
			v_tmp.push_back(tmp);
		}
		v_tmp.push_back(sum);
		sp.push_back(v_tmp);
	}
	int all = 0;
	vector<int> v_tmp;
	for (int i = 0; i < c; i++) {
		int sum = 0;
		for (int j = 0; j < r; j++) {
			sum += sp[j][i];
		}
		all += sum;
		v_tmp.push_back(sum);
	}
	v_tmp.push_back(all);
	sp.push_back(v_tmp);

	for (auto itr = sp.begin(); itr != sp.end(); ++itr) {
		for (auto itr2 = (*itr).begin(); itr2 != (*itr).end(); ++itr2) {
			if (itr2 != (*itr).begin()) {
				cout << " ";
			}
			cout << *itr2;
		}
		cout << endl;
	}
	
	return 0;
}



Measured memory_bytes: 3112
import kotlin.math.max

fun readIntList() = readLine()!!.split(" ").map(String::toInt)
fun calc(n: Int) = (n * (n + 1) / 2.toDouble()) / n

fun main() {
    val (n, k) = readIntList()
    val p = readIntList()
    var res = 0.0

    for (i in 0 until k) {
        res += calc(p[i])
    }

    var last = res
    for (i in k until n) {
        val expected = last + calc(p[i]) - calc(p[i - k])
        res = max(res, expected)
        last = expected
    }

    println(res)
}

Measured memory_bytes: 65484
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)

#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

const int INF = 1<<29;        // 十分大きい値にする, INT_MAX にしないのはオーバーフロー対策

// 入力
int n;
string x,y;

// DPテーブル
int dp[1010][1010];

void printdp() {
    // cout << "--------------" << endl;
    // cout << "    ";
    // REP(i, y.size()+1) {
    //     cout << y[i-1] << "   ";
    // }
    // cout << endl;
    // REP(i, x.size() + 1) {
    //     cout << x[i-1] << ":";
    //     REP(j, y.size() + 1) {
    //         cout << setw(3) <<  (dp[i][j] == INF ? 9 : dp[i][j]) << " ";
    //     }
    //     cout << endl;
    // }
}


int main() {
    cin >> x >> y;

    memset(dp, 0, sizeof(dp));
    REP(i, x.size()+1) dp[i][0] = i;
    REP(i, y.size()+1) dp[0][i] = i;

    REP(j, x.size()+1) {
        REP(k, y.size()+1) {
            if(x[j] == y[k]) {
                dp[j+1][k+1] = dp[j][k];
            } else {
                dp[j+1][k+1] = min(
                    dp[j][k+1] + 1,
                    min(
                        dp[j+1][k] + 1,
                        dp[j][k] + 1)
                );
            }
        }

        printdp();
    }

    cout << dp[x.size()][y.size()] << endl;

}


Measured memory_bytes: 7188
#!/usr/bin python3
# -*- coding: utf-8 -*-

n = int(input())
a = list(map(int, input().split()))
m = 0
for i, ai in enumerate(a):
    if abs(ai) >= m:
        m = abs(ai)
        mi = i
ret= [[mi+1, i+1] for i in range(n)]
if a[mi] >= 0:
    for i in range(n-1):
        ret.append([i+1, i+2])
else:
    for i in range(n-2, -1, -1):
        ret.append([i+2, i+1])  #i+1->i
print(2*n-1)
for x in ret:
    print(" ".join(map(str, x)))


Measured memory_bytes: 9212
#include <bits/stdc++.h>
#define ALL(v) v.begin(), v.end()
#define MOD 1000000007
#define MAX 510000
#define Rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep(i, n) for(ll i = 1; i <= (ll)(n); i++)

using namespace std;
typedef long long int  ll;
typedef pair<int, int> P;

//cout << fixed << setprecision(10);//
//最小公倍数//
ll gcd(ll x, ll y) {
	if (x == 0) return y;
	return gcd(y%x, x);
}
ll lcm(ll x, ll y) { return x * y / gcd(x, y); }

//べき//
ll squ(ll n, ll p, ll m){
	if(p==0) return 1;
	if(p%2==0){
		ll t=squ(n, p/2, m);
		return t*t%m;
	}
	return n*squ(n,p-1,m);
	
}


//逆元mod(mを法とするaの逆元)//
long long modinv(long long a, long long m) {
	long long b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}

//Cmonp//
ll fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

// 二項係数計算
ll COM(ll n, ll k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

//nが大

ll com(ll n,ll m){
    if(n<m || n<=0 ||m<0){
		return 0;
	}
	if( m==0 || n==m){
		return 1;
	}
	
	ll k=1;
	for(ll i=1;i<=m;i++){
       k*=(n-i+1); 
	   k%=MOD;
	   k*=modinv(i,MOD);
	   k%=MOD;
	}

	return k;
}


////////////////////////////////////////////////////////////////////

ll a[100005];

int judge(int n){
	ll y;
ll b[100005];
ll ch=0;


for(int i=1;i<=n;i++){
	if(i==1){y=a[1];
	if(y%2){y--;
	ch=1;
	}
	}
else{
	if(a[i]%2){
		ch++;
		y=gcd(y,a[i]-1);
	}
	else{
		y=gcd(y,a[i]);
	}

}

if(a[i]==1){return 0;}
if(ch>=2){return 0;}

}


if(ch==0){return 0;}
if(y==1||y%2==1){return 0;}
ll sum=0;
for(int i=1;i<=n;i++){
	if(a[i]%2==0){
	b[i]=a[i]/y;}
	else{
		b[i]=(a[i]-1)/y;
	}
if((a[i]-b[i])%2)sum++;
}
if(sum%2){return 0;}
for(int i=1;i<=n;i++){
	a[i]=b[i];
}

return 1;

}






int main() {
ll n;
cin>>n;

ll sum=0;
rep(i, n){
	cin>>a[i];
	sum+=a[i];
}

if(n%2==0){
	if(sum%2==0){
		cout<<"Second"<<endl;
	}
	else{
		cout<<"First"<<endl;
	}
	return 0;
}

if(sum%2==0){cout<<"First"<<endl;
return 0;}

ll inv=0;
for(int u=1;u<=50;u++){
if(judge(n)==1){
	inv++;
}
else{
	break;
}
}



if(inv%2){cout<<"First"<<endl;}
else{cout<<"Second"<<endl;}
return 0;



}





Measured memory_bytes: 1792
N = int(input())
x, y = [], []
for i in range(N):
    _x, _y = map(int, input().split())
    x.append(_x)
    y.append(_y)

sums = 0
for i in range(N-1):
    for j in range(i+1, N):
        sums += ((x[i]-x[j])**2 + (y[i]-y[j])**2)**0.5

ans = sums * (N-1) / (N*(N-1)/2)
print(ans)


Measured memory_bytes: 3188
#include <cassert>
#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>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#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>
#include <array>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#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>

using namespace std;
using ll = long long;
using ull = unsigned long long;

#ifndef __MACRO_H__
#define __MACRO_H__

#define all(collection)  (collection).begin(), (collection).end()		// begin to end
#define rep(i, begin, end) for (ll i = begin; i < end; i++)					// repeat
#define repr(i, begin, end) for (ll i = begin - 1; end <= i; i--)		// repeat reverse

std::chrono::system_clock::time_point  start;

void TimeStart(void)
{
	start = std::chrono::system_clock::now();
}

void TimeEnd(void)
{
	auto time = std::chrono::system_clock::now() - start;
	auto msec = std::chrono::duration_cast<std::chrono::milliseconds>(time).count();
	cerr << endl << msec << " msec " << endl;
}

#endif

class DPB
{
public:
	DPB()
	{
		cin >> n >> k;
		h.resize(n);
		rep(i, 0, n)
			cin >> h[i];
	}
	void Run(void)
	{
		vector<ll> ans(n);
		vector<vector<ll>> dp(n, vector<ll>(k, LLONG_MAX));
		dp[0][0] = ans[0] = 0;
		rep(i, 0, n)
		{
			rep(j, 0, k)
			{
				if (0 <= i - j - 1)
					dp[i][j] = ans[i - j - 1] + abs(h[i - j - 1] - h[i]);
			}

			ans[i] = *min_element(all(dp[i]));
		}

		cout << ans[n-1];
	}
private:
	ll n;
	ll k;
	vector<ll> h;
};

int main(void)
{
	DPB dpb;
	dpb.Run();

	return 0;
}


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

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;

#define F first
#define S second
#define PB push_back
#define MP make_pair
#define what_is(x) cerr << #x << " is " << x << endl;
#define MT make_tuple
#define eb emplace_back
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))

#define REP(i,a,b) for (int i = a; i <= b; i++)
#define FOR(i,n) for (int i=0;i < n ; i++)
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }

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...);
}

int main(){
	int h, w;
	cin >> h >> w;
	string s[h+1];
	for(int i=1; i <=h; i++)
		cin >> s[i];
	for(int i=1; i <=2*h;i++)
		
			cout << s[(i+1)/2] <<"\n";
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
 
int card[255][14]={{0}};
 
int main(void){
    int n;
    cin>>n;
    for(int i=0; i<n; i++){
        char c;
        int num;
        cin>>c>>num;
        card[(int)c][num]=1;
         
    }
    for(int i=1; i<=13; i++){
        if(card[(int)'S'][i]==0){
            cout<<"S "<<i<<endl;
        }
    }
    for(int i=1; i<=13; i++){
        if(card[(int)'H'][i]==0){
            cout<<"H "<<i<<endl;
        }
    }
    for(int i=1; i<=13; i++){
        if(card[(int)'C'][i]==0){
            cout<<"C "<<i<<endl;
        }
    }
    for(int i=1; i<=13; i++){
        if(card[(int)'D'][i]==0){
            cout<<"D "<<i<<endl;
        }
    }
}


Measured memory_bytes: 3092
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <bitset>
#include <utility>
#include <numeric>

using namespace std;

using ll = long long;
using ull = unsigned long long;

const ll inf = (ll)1e9;
const ll mod = (ll)1e9 + 7;

#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()

#define print(s) cout << s;
#define println(s) cout << s << endl;
#define printd(s, f) cout << fixed << setprecision(f) << s << endl;


int main()
{
	int n, m;
	cin >> m >> n;

	vector<vector<int>> a(m);

	for (int i = 0; i < n; i++)
	{
		int p, q;
		cin >> q >> p;

		int x;
		bool b = false;

		switch (q)
		{
			case 0:
				cin >> x;
				a[p].push_back(x);
				break;

			case 1:
				b = false;
				for (int j : a[p])
				{
					print((b ? " " : "") << j);
					b = true;
				}
				println("");
				break;

			case 2:
				a[p].clear();
				break;
		}
	}
}




Measured memory_bytes: 5880
using System;
using System.Linq;

namespace AtCoder.Abc
{
    public class QuestionA
    {
        public static void Main(string[] args)
        {
            var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);

            // 整数配列の入力
            var inputLongArray = Console.ReadLine().Split(' ').Select(i => long.Parse(i)).ToArray();

            var index = -1;
            for (int i = 0; i < inputLongArray.Length; i++)
            {
                if (inputLongArray[i] == 0)
                {
                    index = i;
                }
            }
           
            Console.WriteLine(index + 1);

            Console.Out.Flush();
        }
    }
}


Measured memory_bytes: 28036
#include <iostream>
#include <vector>
#include <functional>

template <class Cost = int>
struct Edge {
    int from, to;
    Cost cost;
    Edge(int from, int to, Cost cost = 1)
        : from(from), to(to), cost(cost){};

    bool operator<(const Edge<Cost>& e) const { return this->cost < e.cost; }
    bool operator>(const Edge<Cost>& e) const { return this->cost > e.cost; }
};

template <class Cost = int>
using Edges = std::vector<Edge<Cost>>;

template <class Cost = int>
class Graph {
public:
    int size;
    std::vector<std::vector<Edge<Cost>>> path;

    explicit Graph(int N = 0) : size(N), path(size) {}
    void span(int u, int v, Cost cost = 1) {
        path[u].push_back(Edge<Cost>(u, v, cost));
    }
    std::vector<Edge<Cost>> operator[](int v) const { return path[v]; }
};

template <class Data, class Operator>
class BinaryIndexedTree {
    using DataMerger = std::function<Data(Data, Data)>;   // データをマージする関数
    using Applier = std::function<Data(Data, Operator)>;  // 作用素をデータに作用させる関数

private:
    int length;
    std::vector<Data> data;
    Data id;
    DataMerger dmerge;
    Applier app;

public:
    explicit BinaryIndexedTree(int length, Data id, DataMerger dmerge, Applier app)
        : length(length), id(id), dmerge(dmerge), app(app) {
        data.assign(length + 1, id);
    }

    // half-open interval [l, r)
    Data query(int l, int r) const { return query(r - 1) - query(l - 1); }

    // closed interval [0, idx]
    Data query(int idx) const {
        ++idx;
        Data sum = id;
        while (idx > 0) {
            sum = dmerge(sum, data[idx]);
            idx -= (idx & -idx);
        }
        return sum;
    }

    void update(int idx, Operator e) {
        ++idx;
        while (idx <= length) {
            data[idx] = app(data[idx], e);
            idx += (idx & -idx);
        }
    }
};

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

    int N;
    std::cin >> N;
    Graph<> graph(N);
    for (int v = 0; v < N; ++v) {
        int k;
        std::cin >> k;
        for (int i = 0; i < k; ++i) {
            int c;
            std::cin >> c;
            graph.span(v, c);
        }
    }

    std::vector<int> order;    // 行きがけ順
    std::vector<int> size(N);  // 部分木の大きさ
    std::function<int(int)> dfs = [&](int v) {
        order.push_back(v);
        size[v] = 1;
        for (auto e : graph[v]) size[v] += dfs(e.to);
        return size[v];
    };
    dfs(0);

    std::vector<int> rev(N);
    for (int i = 0; i < N; ++i) rev[order[i]] = i;

    BinaryIndexedTree<int, int> bit(N, 0,
                                    [](int a, int b) { return a + b; },
                                    [](int a, int b) { return a + b; });

    int Q;
    std::cin >> Q;
    for (int q = 0; q < Q; ++q) {
        int t;
        std::cin >> t;
        if (t == 0) {
            int v, w;
            std::cin >> v >> w;
            bit.update(rev[v], w);
            bit.update(rev[v] + size[v], -w);
        } else {
            int v;
            std::cin >> v;
            std::cout << bit.query(rev[v]) << '\n';
        }
    }
    return 0;
}



Measured memory_bytes: 18456
#include<bits/stdc++.h>
#include<stdio.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
using namespace std;


#define ll                  long long
#define scl(n)              scanf("%lld",&n)
#define scll(n, m)              scanf("%lld%lld",&n, &m)
#define scc(c)	            scanf("%c",&c)
#define fr(i,n)             for (ll i=0;i<n;i++)
#define fr1(i,n)            for(ll i=1;i<=n;i++)
#define pfl(x)              printf("%lld\n",x)
#define pb                  push_back
#define debug               cout<<"I am here"<<endl;
#define pno                 cout<<"NO"<<endl
#define pys                 cout<<"YES"<<endl
#define tcas(i,t)           for(ll i=1;i<=t;i++)

#define l(s)                s.size()
#define asort(a)            sort(a,a+n)
#define all(x) 	            (x).begin(), (x).end()
#define dsort(a)            sort(a,a+n,greater<int>())
#define vasort(v)           sort(v.begin(), v.end());
#define vdsort(v)           sort(v.begin(), v.end(),greater<int>());
#define uniquee(x)          x.erase(unique(x.begin(), x.end()),x.end())
#define pn                  printf("\n")
#define el                  cout<<endl
#define md                  1000000007
#define inf                 9e18

#define N 100006
ll dp[N];

int main()
{
    ll m,n,b,c,d,i,j,k,x,y,z,l,q,r;
    string s,s1, s2, s3, s4;

    ll cnt=0,cn=0,ans=0,sum=0 ;
    cin>>n;
    ll a[n];

    vector<ll>dp(n, inf);

    fr(i,n)cin>>a[i];

    dp[0]=0;

    fr(i, n)
    {
        for(j=i+1; j<=i+2; j++)
        {
            if(j<n )
            {
                dp[j]=min(dp[j], dp[i]+abs(a[i]-a[j] )  );
               // cout<<dp[i]<<" "<<dp[j]<<endl;
            }
        }
    }

    ans=dp[n-1];

    cout<<ans;
    pn;

    return 0;
}

///***************Before submit*****************

///    ****Please check all base case output***
///    *check for integer overflow,array bounds
///    *check for n=1




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

int main(){
    int n, l;
    cin >> n >> l;
    vector<string>s(n);
    for (int i = 0; i < n; i++) {
        cin >> s.at(i);
    }
    sort(s.begin(), s.end());
    for (int i = 0; i < n; i++) {
        cout << s.at(i);
    }
    cout << endl;
}


Measured memory_bytes: 256
n, x, y = gets.split.map &:to_i

d_counts = Hash.new(0)
(1..n-1).each do |i|
  (i+1..n).each do |j|
    d_counts[[j-i, (x-i).abs + (y-j).abs + 1].min] += 1
  end
end

(1..n-1).each do |k|
  p d_counts[k]
end

Measured memory_bytes: 14504
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <functional>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <cassert>
#include <exception>
#include <numeric>
using namespace std;
typedef long long ll;
typedef string str;
typedef pair<ll, ll> Pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<char> vc;
typedef vector<str> vs;
typedef vector<Pll> vp;
typedef vector<bool> vb;
#define rep(i, a, n) for (ll i = (a); i < (n); ++i)
#define rrep(i, a, n) for (ll i = (a); i > (n); --i)
#define erep(i, a, n) for (ll i = (a); i <= (n); ++i)
#define rerep(i, a, n) for (ll i = (a); i >= (n); --i)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define mp make_pair
#define sz(x) ((int)x.size())
#define vec_max(V) *max_element(all(V))
#define vec_min(V) *min_element(all(V))
#define vec_sum(V) accumulate(all(V), 0LL)
#define print(X) cout << (X) << "\n"
#define _ << " " <<
#define Yes print("Yes")
#define No print("No")
static const int INF = 1e+9+7;

int main(){
  ll N,M;
  cin >> N >> M;
  ll L = 0;
  ll R = INF;
  rep(i,0,M){
    ll l,r;
    cin >> l >> r;
    if(L < l) L = l;
    if(R > r) R = r;
  }

  if(L > R) print(0);
  else print(R-L+1);


 return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <vector>
#include <iostream>
#include<algorithm>
#include<string>
#include <map>
#include <queue>
#include <stack>
#include<set>

#define DIV 1000000007
#define TE 2e5
using namespace std;
using ll = long long;
using ldb = long double;

int main() {
	ll N, M; cin >> N >> M;
	ll ans;
	if (2 * N >= M) cout << M / 2 << endl;
	else {
		cout << N + (M - 2 * N) / 4 << endl;
	}
}


Measured memory_bytes: 3596
N, M = map(int,input().split())
A = [list(map(int,input().split())) for _ in range(N)]

d = {}
for i in range(N):
  K = A[i][0]
  for j in range(1,K+1):
    A[i][j]
    if(A[i][j] in d):
      d[A[i][j]] += 1
    else:
      d[A[i][j]] = 1
cnt = 0
for k, v in d.items():
  if(v == N):
    cnt += 1
print(cnt)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
string S;
int n;
int main(void){
    cin >> n;
    cin >> S;
    int blue = 0, red = 0;
    for (int i = 0; i < n; ++i){
        if (S[i] == 'R'){
            red++;
        }else{
            blue++;
        }
    }
    if (red > blue){
        cout << "Yes" << endl;
        return 0;
    }
    cout << "No" << endl;
}


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

using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
 
#define nl '\n'
 
#define y1 aza_ibagaliev
 
#define f first
#define s second
	
#define ed end()
#define bg begin()
#define rbg rbegin()
 
#define rv reverse
#define mp make_pair
#define pb push_back
#define ppb pop_back
#define ppf pop_front
 
#define sz size()
#define all(x) x.bg, x.ed
 
#define pll pair < ll, ll >
#define pii pair < int, int >
 
#define sqr(x) ((x) * 1ll * (x))
#define sqrd(x) ((x) * 1.0 * (x))
 
#define speed ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
 
#define rnl cout << "----------------------------------------" << nl
 
#define bit __builtin_popcount
 
inline ll bip(ll x, ll n, ll mod){ll res=1;while(n){if(n & 1){res=(res*x)%mod;}x=(x*x)%mod;n>>=1;}return res;}
        	
const int ppr = 257;
const ll INF = 2e18;
const int inf = 2e9;
const int mod = 1e9 + 7;
const int N = 1e5 + 123;
const ld pi = 3.1741592653589793238462643;
 
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};

int n, m, dp[1005][1005];
char c[1005][1005];

main() {             	
//  freopen(".in", "r", stdin);
//  freopen(".out", "w", stdout);

//	srand(time(NULL));

	cin >> n >> m;

	for(int i = 1; i <= n; i++)
		for(int j = 1; j <= m; j++)
			cin >> c[i][j];

	dp[1][1] = 1;

	for(int i = 1; i <= n; i++)
		for(int j = 1; j <= m; j++) {
			if(c[i][j] == '#') continue;
			dp[i + 1][j] = (dp[i + 1][j] + dp[i][j]) % mod;
			dp[i][j + 1] = (dp[i][j + 1] + dp[i][j]) % mod;
		}

	cout << dp[n][m];
	        	

    return 0;                                        
}

Measured memory_bytes: 5120
#include <bits/stdc++.h>
using namespace std;
#define rep(i, k, n) for(int i = k; i < (n); i++)
using ll = long long;

int main(){
    int n, k;
    cin >> n >> k;
    vector<char> s(n);
    rep(i, 0, n){cin >> s[i];}
    map<char, char> alpha;
    alpha['A'] = 'a';
    alpha['B'] = 'b';
    alpha['C'] = 'c';
    rep(i, 0, n){
        if (i == k-1) cout << alpha[s[i]];
        else cout << s[i];
    }
    cout << endl;
    return 0;
}   

Measured memory_bytes: 256
#include<cstdio>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

int main(){
	for(int n;scanf("%d",&n),n;){
		int ans[3]={},tot[3]={};
		rep(_,n){
			int h,m,m2; scanf("%d:%d%d",&h,&m,&m2);
			if(m2<m) m2+=60;

			int t=60*h+m;
			if     (11<=h && h<15){ tot[0]++; if(m2-m<=8) ans[0]++; }
			else if(18<=h && h<21){ tot[1]++; if(m2-m<=8) ans[1]++; }
			else if(21<=h || h< 2){ tot[2]++; if(m2-m<=8) ans[2]++; }
		}

		char *s[]={"lunch","dinner","midnight"};
		rep(i,3){
			if(tot[i]==0) printf("%s no guest\n",s[i]);
			else          printf("%s %d\n",s[i],100*ans[i]/tot[i]);
		}
	}

	return 0;
}

Measured memory_bytes: 0
N, D = list(map(int, input().split()))
X = []
Y = []
for i in range(N):
    tmpx, tmpy = list(map(int, input().split()))
    X.append(tmpx)
    Y.append(tmpy)
cnt = 0
for i in range(N):
    if (X[i])**2+(Y[i])**2 <= D**2:
        cnt += 1
print(cnt)

Measured memory_bytes: 24916
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Sparsh Sanchorawala
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        AWeLoveGolf solver = new AWeLoveGolf();
        solver.solve(1, in, out);
        out.close();
    }

    static class AWeLoveGolf {
        public void solve(int testNumber, InputReader s, PrintWriter w) {
            int k = s.nextInt(), a = s.nextInt(), b = s.nextInt();
            boolean res = false;
            for (int i = a; i <= b; i++) {
                if (i % k == 0)
                    res = true;
            }
            if (res)
                w.println("OK");
            else
                w.println("NG");
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}



Measured memory_bytes: 32412
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC push_options
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include<bits/stdc++.h>
#include <xmmintrin.h>
#include <immintrin.h>
using namespace::std;
__attribute__((constructor))void init(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/priority_queue.hpp>
#include<ext/pb_ds/tag_and_trait.hpp>
// #include <boost/multiprecision/cpp_dec_float.hpp>
// #include <boost/multiprecision/cpp_int.hpp>
// namespace mp = boost::multiprecision;
// typedef mp::number<mp::cpp_dec_float<0>> cdouble;
// typedef mp::cpp_int cint;
template<typename T>using pbds=__gnu_pbds::tree<T,__gnu_pbds::null_type,less<T>,__gnu_pbds::rb_tree_tag,__gnu_pbds::tree_order_statistics_node_update>;
template<typename T>using pbds_map=__gnu_pbds::tree<T,T,less<T>,__gnu_pbds::rb_tree_tag,__gnu_pbds::tree_order_statistics_node_update>;
template<typename T,typename E>using hash_map=__gnu_pbds::gp_hash_table<T,E>;
template<typename T>using pqueue =__gnu_pbds::priority_queue<T, greater<T>,__gnu_pbds::rc_binomial_heap_tag>;
typedef long long lint;
#define INF (1LL<<60)
#define IINF (1<<30)
//#define EPS (1e-10)
#define endl '\n'
//#define MOD 1000000007LL
#define MOD 998244353LL
typedef vector<lint> vec;
typedef vector<vector<lint>> mat;
typedef vector<vector<vector<lint>>> mat3;
typedef vector<string> svec;
typedef vector<vector<string>> smat;
template<typename T>inline void numout(T t){bool f=0;for(auto i:t){cout<<(f?" ":"")<<i<INF/2?i:"INF";f=1;}cout<<endl;}
template<typename T>inline void numout2(T t){for(auto i:t)numout(i);}
template<typename T>inline void output(T t){bool f=0;for(auto i:t){cout<<(f?" ":"")<<i;f=1;}cout<<endl;}
template<typename T>inline void output2(T t){for(auto i:t)output(i);}
template<typename T>inline void _output(T t){bool f=0;for(lint i=0;i<t.size();i++){cout<<f?"":" "<<t[i];f=1;}cout<<endl;}
template<typename T>inline void _output2(T t){for(lint i=0;i<t.size();i++)output(t[i]);}
#define rep(i,n) for(lint i=0;i<lint(n);++i)
#define repi(i,a,b) for(lint i=lint(a);i<(lint)(b);++i)
#define rrep(i,n) for(lint i=lint(n)-1;i>=0;--i)
#define rrepi(i,a,b) for(lint i=lint(b)-1;i>=lint(a);--i)
#define irep(i) for(lint i=0;;++i)
#define all(n) begin(n),end(n)
#define dist(a,b,c,d) sqrt(pow(a-c,2)+pow(b-d,2))
inline lint gcd(lint A,lint B){return B?gcd(B,A%B):A;}
inline lint lcm(lint A,lint B){return A/gcd(A,B)*B;}
// inline cint cgcd(cint A,cint B){return B?cgcd(B,A%B):A;}
// inline cint clcm(cint A,cint B){return A/cgcd(A,B)*B;}
inline bool chmin(auto& s,const auto& t){bool res=s>t;s=min(s,t);return res;}
inline bool chmax(auto& s,const auto& t){bool res=s<t;s=max(s,t);return res;}
const vector<lint> dx={1,0,-1,0,1,1,-1,-1};
const vector<lint> dy={0,1,0,-1,1,-1,1,-1};
#define SUM(v) accumulate(all(v),0LL)
auto call=[](auto f,auto... args){return f(f,args...);};



int main(){
    lint n,m;
    cin>>n>>m;
    if(min(n,m)==1)cout<<1<<endl;
    else cout<<(n*m+1)/2<<endl;
}


Measured memory_bytes: 256
// #pragma GCC optimize(3, "Ofast", "inline")
#include <bits/stdc++.h>
#define String std::string
#define fir first
#define sec second
#define mp std::make_pair
#define Pair std::pair<int, int>
#define Map std::map< int, int >
#define Vector std::vector<int>

typedef long long ll;
typedef unsigned long long ull;

const int N = 100000 + 5;
const int M = 3000 + 5;
const int MOD = 1e9 + 7;
const int inv2 = 500000004;
const int dx[] = { 0, 1, -1, 0, 1, -1, 1, -1 };
const int dy[] = { 1, 0, 0, -1, 1, -1, -1, 1 };

template<class T>
inline T readT() {
    T res = 0, f = 1;
    char ch = getchar();
    for (; !isdigit(ch); ch = getchar()) if (ch == '-') f = -1;
    for (; isdigit(ch); ch = getchar()) res = (res << 1) + (res << 3) + ch - '0';
    return res * f;
}
#define read readT<int>

int a, b, c;
int n;

int main() {
    std::cin >> a >> b >> c;
    printf("%d\n", std::min(c, b / a));
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>

#include <iostream>
#include <iomanip>
#include <sstream>
#include <stdint.h>
#include <string.h>

#define _USE_MATH_DEFINES
#include <math.h>

#include <vector>
#include <list>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <deque>
#include <string>

#include <algorithm>
#include <functional>
#include <bitset>
#include <functional>
#include <chrono>
#include <random>

#define sqr(x) (x) * (x)

typedef unsigned int u32;
typedef int i32;
typedef unsigned long long int u64;
typedef long long int i64;
typedef uint16_t u16;
typedef int16_t i16;
typedef uint8_t u8;
typedef int8_t i8;

using namespace std;
using namespace std::chrono;

const i64 mod = 1000000007ll;
const i64 smod = 998244353ll;
const i64 inf = 10000000000000007ll;

const double eps = 1e-10;

const i64 MAXN = 300005;

i64 n;
pair<i64, i64> a[MAXN];
vector <i64> q;

double cmpt() {
    double R = 0;
    for (i64 i = 1; i < q.size(); i++) {
        auto p0 = a[q[i - 1]];
        auto p1 = a[q[i]];

        double t = sqrt(sqr(p0.first - p1.first) + sqr(p0.second - p1.second));
        R += t;
    }

    return R;
}

int main() {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cout.precision(15); cout.setf(ios::fixed);

    cin >> n;
    for (i64 i = 0; i < n; i++) {
        cin >> a[i].first >> a[i].second;
        q.push_back(i);
    }

    double R = 0;
    i64 cnt = 0;
    do {
        R += cmpt();
        cnt += 1;
    } while (next_permutation(q.begin(), q.end()));

    cout << R / cnt << endl;
    return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Competitive
{
    internal class Solution
    {
        public int R;
        public void Run()
        {
            R = Input.ReadInt();
            if(R < 1200) Console.WriteLine("ABC");
            else if(R < 2800) Console.WriteLine("ARC");
            else Console.WriteLine("AGC");
        }
    }

    // libs ----------
    

    // common ----------

    internal static class Input
    {
        public static string ReadString()
        {
            string line = Console.ReadLine();
            return line;
        }

        public static int ReadInt()
        {
            string line = Console.ReadLine();
            return int.Parse(line);
        }

        public static int[] ReadIntArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(int.Parse).ToArray();            
        }

        public static long ReadLong()
        {
            string line = Console.ReadLine();
            return long.Parse(line);
        }

        public static long[] ReadLongArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(long.Parse).ToArray();
        }

        public static double[] ReadDoubleArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(double.Parse).ToArray();
        }
    }
    
    internal class Program
    {
        public static void Main(string[] args)
        {
            var s = new Solution();
            s.Run();
        }
    }
}

Measured memory_bytes: 11092