akhauriyash/Code-Regression huggingface dataset:
# Bubble Sort
n = int(input())
line = [int(i) for i in input().rstrip().split()]
# print(line)

count = 0
for i in range(n - 1):
    a = n - 1
    while a > i:
        if line[a - 1] > line[a]:
            line[a - 1], line[a] = line[a], line[a - 1]
            # print(line)
            count += 1
        a -= 1

for i in range(n):
    print(line[i], end = "")
    if i < n - 1:
        print(" ", end = "")
print()
# print(line)
print(count)



Measured memory_bytes: 5620
#include<bits/stdc++.h>
using namespace std;
#define ms(x,y) memset(x, y, sizeof(x))
#define lowbit(x) ((x)&(-x))
#define sqr(x) ((x)*(x))
typedef long long LL;
typedef pair<int,int> pii;
typedef pair<LL,LL> pll;

LL calc(LL x) {
    return x*x*x*x*x;
}

void run_case() {
    LL x, a, b;
    cin >> x;
    for(a = -118; a <= 119; ++a) {
        for(b = -119; b <= 118; ++b) {
            LL tmp = calc(a) - calc(b);
            if(tmp == x) {
                cout << a << " " << b;
                return;
            }
        }
    }
}


int main() {
    ios::sync_with_stdio(false), cin.tie(0);
    cout.flags(ios::fixed);cout.precision(9);
    //int t; cin >> t;
    //while(t--)
    run_case();
    cout.flush();
    return 0;
}

Measured memory_bytes: 3636
#include <cstdio>
#include <algorithm>

int main() {
  int N;
  scanf("%d", &N);

  int dec=0, rem=0, min=200;
  for (int i=0; i<N; ++i) {
    int d;
    scanf("%d", &d);
    if (d % 10 == 0) {
      dec += d;
    } else {
      rem += d;
      if (min > d)
        min = d;
    }
  }

  if (rem == 0) {
    printf("0\n");
    return 0;
  }

  if (rem % 10 == 0) {
    printf("%d\n", dec+rem-min);
  } else {
    printf("%d\n", dec+rem);
  }

  return 0;
}


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

int main(void) {
  long long N, M;
  cin >> N >> M;
  if (N == 1 && M == 1) {
    cout << 1 << endl;
  } else if (N == 1) {
    cout << M - 2 << endl;
  } else if (M == 1) {
    cout << N - 2 << endl;
  } else {
    cout << (N - 2) * (M - 2) << endl;
  }
  return 0;
}

Measured memory_bytes: 256
#include"bits/stdc++.h"
using namespace std;
using ll=long long;
template<typename T=ll>inline T in(istream&is=cin){T ret;is>>ret;return ret;}
template<typename T>inline auto vec2(typename vector<T>::size_type h,typename vector<T>::size_type w,T v=T()){return vector<vector<T>>(h,vector<T>(w,v));}

int main()
{
    ll N=in(),W=in();
    vector<ll>v(N),w(N);
    for(ll i=0;i<N;++i){
        v[i]=in();
        w[i]=in();
    }
    auto dp=vec2<ll>(N+1,W+1,0);
    for(ll i=1;i<=N;++i){
        for(ll j=0;j<=W;++j){
            if(j<w[i-1]){
                dp[i][j]=dp[i-1][j];
            }else{
                dp[i][j]=max(dp[i-1][j],dp[i-1][j-w[i-1]]+v[i-1]);
            }
        }
    }
    cout<<dp[N][W]<<endl;
}



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

using ll = long long;
#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, n, m) for(int (i)=(n); (i)<(m); ++i)
constexpr int INF = 1e9;
//constexpr ll INF = 1LL << 61;
constexpr int mod = 1e9+7;

int main(){
  string S;
  cin >> S;
  if(S.back() == 's'){
    S+="es";
  }
  else{
    S += "s";
  }
  cout << S << endl;
  return 0;
}


Measured memory_bytes: 3624
#include<stdio.h>
int main()
{
    int n,r;
    scanf("%d%d",&n,&r);
    if(n>=10)
    {
        printf("%d\n",r);
    }
    else
    {
        int s=r+100*(10-n);

        printf("%d\n",s);
    }
    return 0;
}


Measured memory_bytes: 1700
#include <iostream>

using namespace std;

bool isok(int* a, int size, int k, long long mean){
    int number = 1;
    int currentweight = 0;
    int i = 0;
    while(i!=size){
        if(a[i]> mean)
            return false;
        if(currentweight+a[i]<=mean){
            currentweight += a[i];
            i++;
        }
        else{
            currentweight = a[i];
            number++;
            i++;
        }
    }
    return (number <= k);
}

int main(){
    int n,k; cin >> n >> k;
    int weight[n];
    for(int i=0;i<n;i++){
        cin >> weight[i];
    }
    long long left = 0;
    long long right = 1000000000;
    long long mean = (left+right)/2;
    while(left!=mean){
        if(isok(weight, n, k, mean)){
            right = mean;
            mean = (left+right)/2;
        }
        else{
            left = mean;
            mean = (left+right)/2;
        }
    }
    cout << mean+1 << endl;
}

Measured memory_bytes: 1544
#include <iostream>

using namespace std;

int main(){
  int n;
  const int v=1000000007;
  cin >> n;
  long long Arr[n],sum=0,tempsum=0,arrsum=0;
  for(int z=0;z<n;z++){
    cin >> Arr[z];
  }
  for(int x=0;x<n;x++){
    arrsum+=Arr[x];
    arrsum%=v;
  }
  for(int x=0;x<n;x++){
    arrsum=(arrsum-Arr[x]+v)%v;
    tempsum=(Arr[x])*(arrsum);
    tempsum%=v;
    sum+=tempsum;
    sum%=v;
  }
  cout << sum;
}

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

int main() {
  int n;
  cin >> n;
  string num = to_string(n);
  
  rep(i, 3) {
    if(num[i] == '7') {
      cout << "Yes" << endl;
      return 0;
    }
  }
  
  cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 3680
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<deque>
#include<cmath>
#include<iomanip>
#include<map>
#include<cstring>

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
using P = pair<int, int>;
const int INF = 1e9;
const ll LLINF = 1LL<<60;
/* -- template -- */

int main() {
    string S; cin >> S;
    int ans = 0;
    rep(i, S.size() - 1){
        if(S[i] == S[i + 1])continue;
        else ++ans;
    }
    cout << ans << endl;
}


Measured memory_bytes: 512
# Dinic's algorithm O(VE^2)
from collections import deque


class Dinic:
    def __init__(self, N):
        self.N = N
        self.G = [[] for i in range(N)]

    def add_edge(self, fr, to, cap):
        forward = [to, cap, None]
        forward[2] = backward = [fr, 0, forward]
        self.G[fr].append(forward)
        self.G[to].append(backward)

    def add_multi_edge(self, v1, v2, cap1, cap2):
        edge1 = [v2, cap1, None]
        edge1[2] = edge2 = [v1, cap2, edge1]
        self.G[v1].append(edge1)
        self.G[v2].append(edge2)

    def bfs(self, s, t):
        self.level = level = [None]*self.N
        deq = deque([s])
        level[s] = 0
        G = self.G
        while deq:
            v = deq.popleft()
            lv = level[v] + 1
            for w, cap, _ in G[v]:
                if cap and level[w] is None:
                    level[w] = lv
                    deq.append(w)
        return level[t] is not None

    def dfs(self, v, t, f):
        if v == t:
            return f
        level = self.level
        for e in self.it[v]:
            w, cap, rev = e
            if cap and level[v] < level[w]:
                d = self.dfs(w, t, min(f, cap))
                if d:
                    e[1] -= d
                    rev[1] += d
                    return d
        return 0

    def flow(self, s, t):
        flow = 0
        INF = 10**9 + 7
        G = self.G
        while self.bfs(s, t):
            *self.it, = map(iter, self.G)
            f = INF
            while f:
                f = self.dfs(s, t, INF)
                flow += f
        return flow


n = int(input())
dinic = Dinic(n * 2 + 2)
red = [tuple(map(int, input().split())) for _ in range(n)]
blue = [tuple(map(int, input().split())) for _ in range(n)]
for i in range(n):
    dinic.add_edge(n*2, i, 1)
    for j in range(n):
        if red[i][0] < blue[j][0] and red[i][1] < blue[j][1]:
            dinic.add_edge(i, j+n, 1)
for i in range(n):
    dinic.add_edge(i+n, n*2+1, 1)
print(dinic.flow(n*2, n*2+1))


Measured memory_bytes: 3956
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<vector<long long> > vvll;
typedef vector<pair<int, int> > vpii;
typedef pair<int, int> pii;
typedef long long ll;
typedef pair<ll, ll> pll;
#define INF 1000000000
#define MOD 1000000007
#define EPSILON 0.00001
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define p_q priority_queue

#define FOR(i, a, b) for (int i=(a); i<=(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define RFOR(i, a, b) for (int i=(a); i >= b; i--)

#define MN 100005
int n, m;
vi e[MN];
int deg[MN];
vi fours;

bool vis[MN];
bool dfs(int cn, int par, int bad){
    if(vis[cn]) return true;
    vis[cn] = true;

    F0R(i, e[cn].size()){
        int nn = e[cn][i];
        if(nn == par || nn == bad) continue;
        if(dfs(nn, cn, bad)) return true;
    }

    return false;
}

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

    cin >> n >> m;
    F0R(_, m){
        int u, v;
        cin >> u >> v;
        e[u].pb(v);
        e[v].pb(u);
        deg[u]++;
        deg[v]++;
    }

    int fct = 0;
    int ofct = 0;

    FOR(i, 1, n){
        if(deg[i] % 2 != 0){
            cout << "No\n";
            return 0;
        }
        if(deg[i] == 4){
            fct++;
            fours.pb(i);
        }
        else if(deg[i] > 4) ofct++;
    }

    /*if(ofct == 0 && fct <= 1){
        cout << "No\n";
    } else{
        cout << "Yes\n";
    }*/
    if(ofct > 0 || fct > 2){
        cout << "Yes\n";
        return 0;
    }
    if(fct <= 1){
        cout << "No\n";
        return 0;
    }

    if(dfs(fours[0], 0, fours[1])){
        cout << "Yes\n";
        return 0;
    }
    memset(vis, false, sizeof vis);
    if(dfs(fours[1], 0, fours[0])){
        cout << "Yes\n";
        return 0;
    }
    cout << "No\n";

    return 0;
}


Measured memory_bytes: 7808
use std::io::prelude::*;
use std::io::stdin;
use std::str::FromStr;

fn main() {
    let r: i32 = read();
    let g: i32 = read();
    let b: i32 = read();
    println!(
        "{}",
        if (100 * r + 10 * g + b) % 4 == 0 {
            "YES"
        } else {
            "NO"
        }
    );
}

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let token: String = stdin
        .lock()
        .bytes()
        .map(|b| b.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()
}


Measured memory_bytes: 4352
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
ll edge_num[100005]={0};
struct uftree{
private:
  vector<ll> par,val,rnk;
public:
  uftree(ll n){
    par.resize(n+5);
    val.resize(n+5);
    rnk.resize(n+5);
    for(int i=0;i<=n;i++){
      par[i]=i;
      val[i]=1;
      rnk[i]=0;
    }
  }
  ll find(ll pos){
    if(par[pos]==pos) return pos;
    else return par[pos]=find(par[pos]);
  }
  bool same(ll a,ll b){
    return find(a)==find(b);
  }
  ll count(ll pos){
    return val[find(pos)];
  }
  void unite(ll a,ll b){
    a=find(a);
    b=find(b);
    if(same(a,b)) return;
    if(rnk[a]<rnk[b]){
      par[a]=b;
      val[b]+=val[a];
    }
    else{
      par[b]=a;
      val[a]+=val[b];
      if(rnk[a]==rnk[b]) rnk[a]++;
    }
  }
};
int main(){
  ll n,m,k;
  cin>>n>>m>>k;
  uftree uf=uftree(n+5);
  for(int i=0;i<m;i++){
    ll s,t;
    cin>>s>>t;
    uf.unite(s,t);
    edge_num[s]++;
    edge_num[t]++;
  }
  vector<ll> ans(n+5);
  for(int i=1;i<=n;i++) ans[i]=uf.count(i)-edge_num[i]-1;
  for(int i=0;i<k;i++){
    ll s,t;
    cin>>s>>t;
    if(uf.same(s,t)){
      ans[s]--;
      ans[t]--;
    }
  }
  for(int i=1;i<=n;i++) cout<<ans[i]<<" ";
  cout<<endl;
}


Measured memory_bytes: 4736
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class Main {

    public static void main(String[] args) throws Exception {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;

        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);

        Task solver = new Task();
        solver.solve(1, in, out);
        out.close();
    }
}

class Task {

    public void solve(int testNumber, InputReader in, PrintWriter out) {
        long n = in.nextLong();
        if (n % 2 == 1) {
            out.println(0);
            return;
        }
        long twoCnt = get(n, 2);
        long fiveCnt = get(n / 2, 5);
        out.println(Math.min(twoCnt, fiveCnt));

   }

    private long get(long n, int b) {
        long ans = 0;
        while (n > 0) {
            ans += n / b;
            n /= b;
        }
        return ans;
    }

}

class InputReader {

    private final BufferedReader reader;
    private StringTokenizer      tokenizer;

    public InputReader(InputStream stream){
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String nextLine() {
        try {
            return reader.readLine();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(nextLine());
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public long nextLong() {
        return Long.parseLong(next());
    }

    public double nextDouble() {
        return Double.parseDouble(next());
    }

}


Measured memory_bytes: 22740
#include <bits/stdc++.h>
#define ll long long
using namespace std;

ll n;

inline ll read(){
	ll s = 0, w = 1;
	char ch = getchar();
	for (; ch < '0' || ch > '9'; ch = getchar()) w *= ch == '-' ? -1 : 1;
	for (; ch >= '0' && ch <= '9'; ch = getchar()) s = s * 10 + ch - '0';
	return s * w;
}

inline void work(){
	n = read();
	if (n >= 30) puts("Yes");
	else puts("No");
}

int main(){
	work();
	return 0;
}

Measured memory_bytes: 3592
#include <bits/stdc++.h>
using namespace std;
using ll  = long long;
using vl  = vector<ll>;
using pll = pair<ll,ll>;
using vll = vector<pll>;

#define COUNT first
#define CHAR  second

bool check(ll X, const vl& A) {
    ll N = A.size(), last = 0;
    vll s(N, pll(0, 0));
    for (int i = 1; i < N; ++i) {
        ll diff = A[i] - A[i-1];
        // a < b  : push_back 0 * (b - a)
        if (diff > 0) {
            if (s[last].CHAR == 0) {
                s[last].COUNT += diff;
            } else {
                s[last+1] = make_pair(diff, 0);
                last++;
            }
        } else {
        // a >= b : pop_back (b - a)
            diff = -diff;
            while (true) {
                if (s[last].COUNT < diff) {
                    diff -= s[last].COUNT;
                    s[last].COUNT = 0;
                    last--;
                } else {
                    s[last].COUNT -= diff;
                    if (s[last].COUNT == 0) last--;
                    break;
                }
            }
        //              and inclement the last element
            bool ng = true;
            for (int l = 0; l <= last; ++l) {
                if (s[l].CHAR != X-1) ng = false;
            }
            if (ng) return false;

            ll cnt = 0;
            while (s[last].CHAR == X-1) {
                cnt += s[last].COUNT;
                last--;
            }
            if (s[last].COUNT == 1) {
                s[last].CHAR++;
            } else {
                s[last].COUNT--;
                s[last+1] = make_pair(1, s[last].CHAR+1);
                last++;
            }
            if (cnt) s[++last] = make_pair(cnt, 0);
        }
    }
    return true;
}

int main() {
    ll N; cin >> N;
    vl A(N+1,0);
    for (int i = 0; i < N; ++i) {
        cin >> A[i+1];
    }

    ll ok = 1e9, ng = 0;
    while (ok - ng > 1) {
        ll mid = (ok + ng) / 2;
        if (check(mid, A)) {
            ok = mid;
        } else  {
            ng = mid;
        }
    }
    cout << ok << endl;
    return 0;
}



Measured memory_bytes: 5064
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define endl "\n"
#define se second
#define ls( s) (s&(-s))
#define ll long long
#define inf 0x3f3f3f3f
const ll N = 200030;
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
const ll mod =    1e9+7;

int main()
{ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
vector<pair<string,int> >vp;
int n;
cin>>n;
for(int i=0;i<n;i++)
{
	string s;int m;
	cin>>s>>m;
	vp.push_back({s,m});
}
string ss;
cin>>ss;
bool b=false;
int c=0;
for(int i=0;i<n;i++)
{
	if(b)
	c+=vp[i].second;
	if(ss==vp[i].first)
	b=true;
}
cout<<c;

}

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

#define FOR(s, i, n) for(int i = s; i n; i++)
typedef long long ll;
const int INF = 1e9;
int main(){
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	
	int h1, s1, h2, s2;
	cin>>h1>>s1>>h2>>s2;
	bool t = 1;
	while(h1>0 && h2>0){
		if(t){
			h2-=s1;
		}else{
			h1-=s2;
		}
		t = !t;
	}
	puts(h1<=0?"No":"Yes");
	return 0;
}

Measured memory_bytes: 3656
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n;
  scanf("%d", &n);
  vector<int> a(n + 1), b(n + 1);
  for (int i = 1; i <= n; ++i)  scanf("%d", &a[i]), b[a[i]] = i;
  vector<int> L1(n + 1), L2(n + 1), R1(n + 1, n + 1), R2(n + 1, n + 1);
  set<int> st;
  for (int i = n; i; --i) {
    auto it = st.lower_bound(b[i]);
    if (it != st.end()) {
      R1[i] = *it;
      ++it;
    }
    if (it != st.end()) {
      R2[i] = *it;
    }
    it = st.lower_bound(b[i]);
    if (it != st.begin()) {
      --it;
      L1[i] = *it;
    }
    if (it != st.begin()) {
      --it;
      L2[i] = *it;
    }
    st.insert(b[i]);
  }
  // for (int i = 1; i <= n; ++i) {
  //   printf("%d%c", L1[a[i]], " \n"[i == n]);
  // }
  // for (int i = 1; i <= n; ++i) {
  //   printf("%d%c", L2[a[i]], " \n"[i == n]);
  // }
  // for (int i = 1; i <= n; ++i) {
  //   printf("%d%c", R1[a[i]], " \n"[i == n]);
  // }
  // for (int i = 1; i <= n; ++i) {
  //   printf("%d%c", R2[a[i]], " \n"[i == n]);
  // }
  ll ans = 0;
  for (int i = 1; i <= n; ++i) {
    ans += (ll)(R2[i] - R1[i]) * (b[i] - L1[i]) * i;
    ans += (ll)(L1[i] - L2[i]) * (R1[i] - b[i]) * i;
  }
  printf("%lld\n", ans);
  return 0;
}


Measured memory_bytes: 7296
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key

typedef long long ll;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair <ll, int> pli;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef long double ld;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
typedef set<int>::iterator sit;
typedef map<int,int>::iterator mit;
typedef vector<int>::iterator vit;

long long INF=numeric_limits<long long>::max();

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    //freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);
    string s;
    cin >> s;
    ll sum = 0;
    for(int i = 0; i < s.length(); i++)
    {
        sum += s[i]-'0';
    }
    if(sum == 1)sum = 10;
    cout << sum << endl;
}



Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <utility>
#include <string>
#include <map>
#include <algorithm>
#include <stdio.h>
#include <set>
#include <cmath>

using namespace std;


int n, m, x;
vector<vector<int>> v;

int re(int num, vector<int> vec){
    if(num == n){
        for(int i = 1; i <= m; i++){
            if(vec[i] < x){
                return 12000000;
            }
        }
        return vec[0];
    }
    vector<int> new_vec = vec;
    for(int i = 0; i < m + 1; i++){
        new_vec[i] += v[num][i];
    }
    int re_1 = re(num + 1, vec);
    int re_2 = re(num + 1, new_vec);
    if(re_1 <= re_2){
        return re_1;
    } else {
        return re_2;
    }
}

int main() {
    cin >> n >> m >> x;
    for(int i = 0; i < n; i++){
        vector<int> vv;
        for(int j = 0; j < m + 1; j++){
            int xx;
            cin >> xx;
            vv.push_back(xx);
        }
        v.push_back(vv);
    }
    vector<int> vvv;
    for(int i = 0; i < m + 1; i++){
        vvv.push_back(0);
    }
    int ans = re(0, vvv);
    if(ans == 12000000){
        cout << -1 << endl;
    } else {
        cout << ans << endl;
    }
}


Measured memory_bytes: 3620
#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef pair<int,int>P;

int d[20],p[20];
char s[2];
int main(){
	int n,l;
	while(scanf("%d%d",&n,&l),n){
		vector<P>v;
		rep(i,n){
			scanf("%s%d",s,&p[i]);
			if(s[0]=='L')d[i]=-1;
			else d[i]=1;
			v.push_back(P(p[i],i));
		}
		int cnt=0,a;
		while(!v.empty()){
			cnt++;
			vector<P>u;
			int A=-1;
			rep(i,v.size()){
				P p=v[i];
				p.first+=d[p.second];
				if(p.first==0||p.first==l){
					if(A==-1||p.first==0)A=p.second;
					continue;
				}
				u.push_back(p);
			}
			a=A;
			sort(u.begin(),u.end());
			rep(i,int(u.size())-1){
				if(u[i].first==u[i+1].first){
					d[u[i].second]=-d[u[i].second];
					d[u[i+1].second]=-d[u[i+1].second];
				}
			}
			v=u;
		}
		printf("%d %d\n",cnt,a+1);
	}
}

Measured memory_bytes: 3204
import collections


def main():
    n, a = map(int, input().split())
    x = list(map(int, input().split()))

    d = collections.defaultdict(int)
    d[0] = 1

    for c in x:
        current = list(d.items())
        for diff, count in current:
            delta = diff + c - a
            d[delta] = d[delta] + count

    print(d[0] - 1)


if __name__ == '__main__':
    main()


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


#define f first
#define s second
#define pb push_back
#define mp make_pair
#define ts to_string
#define ub upper_bound
#define lb lower_bound
#define ar array
#define all(x) x.begin(), x.end()
#define siz(x) (int)x.size()
#define FOR(x, y, z) for(int x = (y); x < (z); x++)
#define ROF(x, y, z) for(int x = (y-1); x >= (z); x--)
#define F0R(x, z) FOR(x, 0, z)
#define R0F(x, z) ROF(x, z, 0)
#define trav(x, y) for(auto&x:y)

const string nl = "\n";
using ll = int64_t;
using vi = vector<int>;
using vl = vector<ll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using str = string;
using vpii = vector<pii>;
using vpll = vector<pll>;


template<class T> inline bool ckmin(T&a, T b) {return b < a ? a = b, 1 : 0;}
template<class T> inline bool ckmax(T&a, T b) {return b > a ? a = b, 1 : 0;}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void usaco(string x=""){
    ios_base::sync_with_stdio(0); cin.tie(0); x=x;
#ifndef D
    if(siz(x)){
        freopen((x+".in").c_str(), "r", stdin);
        freopen((x+".out").c_str(), "w", stdout);
    }
#endif
}


str ts(char c) { return str(1,c); }
str ts(bool b) { return b ? "true" : "false"; }
str ts(const char* s) { return (str)s; }
str ts(str s) { return s; }
template<class A> str ts(complex<A> c) { 
    stringstream ss; ss << c; return ss.str(); }
str ts(vector<bool> v) { 
    str res = "{"; for(int i = 0;i < (int)v.size(); i++) res += char('0'+v[i]);
    res += "}"; return res; }
template<size_t SZ> str ts(bitset<SZ> b) {
    str res = ""; for(int i = 0; i < b.size(); i++) res += char('0'+b[i]);
    return res; }
template<class A, class B> str ts(pair<A,B> p);
template<class T> str ts(T v) { 
    bool fst = 1; str res = "{";
    for (const auto& x: v) {
        if (!fst) res += ", ";
        fst = 0; res += ts(x);
    }
    res += "}"; return res;
}
template<class A, class B> str ts(pair<A,B> p) {
    return "("+ts(p.f)+", "+ts(p.s)+")"; }
void DBG() { cerr << "]" << endl; }
template<class H, class... T> void DBG(H h, T... t) {
    cerr << ts(h); if (sizeof...(t)) cerr << ", ";
    DBG(t...); }


#ifdef D 
#define dbg(...) cerr << "LINE(" << __LINE__ << ") -> [" << #__VA_ARGS__ << "]: [", DBG(__VA_ARGS__)
#else
#define dbg(...) 0
#endif



signed main(){
    usaco("");
    int x; cin >> x;
    cout << (x^1) << nl;
}
/*
 * Stuff I should try:
 * Is it Monotonic? -> Binary Search
 * Is N small? -> Bitsets or other exponential
 * Edge Cases? Look Carefully 
 * Can't figure anything out? Brute Force and see patterns
 * Try to prove greedies
 * Prefix Sums, Amortization, DP, Data Structures
*/



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

// macro
#define rep(i,n) for(i=0;i<n;i++)
#define ll long long
#define all(v) v.begin(), v.end()

// code starts
int main()
{
  int n;cin>>n;
  vector<double> p(n);
  int i,j;
  rep(i,n)cin>>p[i];
  vector<vector<double>> dp(n+1,vector<double>(n+1));
  dp[0][0]=1;
  for(i=1;i<=n;i++)
  {
    rep(j,i+1)
    {
      if(i-j-1<0)
      {
        dp[i-j][j]=dp[i-j][j-1]*(1-p[i-1]);
      }
      else if(j-1<0)
      {
        dp[i-j][j]=dp[i-j-1][j]*p[i-1];
      }
      else
      {
        dp[i-j][j]=dp[i-j-1][j]*p[i-1]+dp[i-j][j-1]*(1-p[i-1]);
      }
    }
  }
  double ans=0.0;
  i=0;
  while(n-i>i)
  {
    ans+=dp[n-i][i];
    i++;
  }
  cout<<fixed<<setprecision(11)<<ans<<endl;
}

Measured memory_bytes: 70656
#include<stdio.h>
int main(){
    int i,j,k,tmp,N,a[128],b=0;
    scanf("%d",&N);

    for(k = 0;k < N;k++){
        scanf("%d",&a[k]);
    }

    for(i = 0;i < N;i++){
        for(j = 0;j < N-1;j++){
            if(a[j] > a[j+1]){
                tmp = a[j];
                a[j] = a[j+1];
                a[j+1] = tmp;
                b++;
            }
        }
    }

    for(k = 0;k < N-1;k++){
        printf("%d ",a[k]);
    }
    printf("%d\n",a[N-1]);
    printf("%d\n",b);
    return 0;
}

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

int main() {
  int n,h[105],ans=0;
  cin>>n;
  for(int i=0; i<n; i++) cin>>h[i];
  for(int i=0; i<n-1; i++){
    if(h[i]>h[i+1]) ans += h[i] - h[i+1];
  }
  cout<<ans + h[n-1];
}


Measured memory_bytes: 256
//
//  atcoder.cpp
//
//
///
#include <bits/stdc++.h>
#define REP(i, N) for(int i=0; i<N; i++)
using namespace std;

//#include "atcoder.hpp"

long long gcd(long long a, long long b) {
    if (a>b) swap(a,b);
    
    auto r = b % a;
    
    return (r ? gcd(r, a) : a);
}

int main() {
    int N,K;string S;
    
    cin >> N >> S >> K;
    
    auto tg = S[K-1];
    
    for (auto& i : S)
     if (i != tg)
    i = '*';

    cout << S << endl;
    
    return 0;
}


Measured memory_bytes: 256
require 'prime'

a = gets.to_i
result = 0
(1..a).each do |b|
  next if b % 2 == 0
  next if Prime.instance.prime?(b)
  i = 0
  (1..b).each do |c|
    next if b % 2 == 0
    next if Prime.instance.prime?(b)
    i+=1 if b % c == 0
  end
  result+=1 if i == 8
end
puts result

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

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        
        String[] nums = reader.readLine().split(" ");
        Arrays.sort(nums);
        int result = Integer.parseInt(nums[0]) + Integer.parseInt(nums[2]) * 10 + Integer.parseInt(nums[1]);
        System.out.println(result);
    }
}


Measured memory_bytes: 23124
#include <bits/stdc++.h>
#include <string>
#include <iostream>
#include <iomanip>
#include <cstdlib> //絶対値整数abs
#include <cmath>   //絶対値少数fbs
#include <math.h>
using namespace std;
#define rep(i, N) for (ll i = 0; i < (N); i++)
typedef long long ll;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll R;
    cin >> R;
    cout << R * 3.1415 * 2 << endl;
}

Measured memory_bytes: 3804
#include <iostream>
#include <string>

int main(){

    std::string S;
    std::cin >>S;

    std::string W[3];
    W[0]="Sunny";
    W[1]="Cloudy";
    W[2]="Rainy";


    for(int i=0;i<3;i++){
        if(S==W[i]){

            std::cout<<W[(i+1)%3];
            break;
        }
    }
    
    return 0;
}



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

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

  int last;
  cin >> last;

  ll res = 0;

  rep(i, n - 1) {
    int a;
    cin >> a;

    int stool = max(last - a, 0);
    res += stool;

    last = a + stool;
  }

  cout << res << endl;

  return 0;
}


Measured memory_bytes: 3632
#include <stdio.h>

int main(void){
  int i;
  char st,al[53] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
  
  do{
    scanf("%c", &st);

    for(i=0;i<52;i++)
      if(al[i] == st){
        st = al[ (i+26)%52 ];
        break;
      }

    printf("%c", st);

  }while(st != '\n');

  return 0;
}

Measured memory_bytes: 524
#include <stdio.h>

int main(void)
{
  char s[100001];
  scanf("%s", s);
  int a[2] = {};
  for (int i = 0; s[i] != '\0'; i++) {
    a[s[i] - '0' == i % 2]++;
  }
  printf("%d\n", a[0] < a[1] ? a[0] : a[1]);
}


Measured memory_bytes: 256
// In the name of God

#include <bits/stdc++.h>

using namespace std;

const int MAX = 16005;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	string s;
	cin >> s;
	int x, y;	
	cin >> x >> y;
	vector<int> comps;
	int len = 0;
	for(int i = 0; i < s.length(); i++) {
		if(s[i] == 'T') {
			comps.push_back(len);
			len = 0;
		}
		else len++;
	}
	comps.push_back(len);
	x -= comps[0];
	vector<int> xs, ys;
	for(int i = 1; i < comps.size(); i++) {
		if(i & 1) ys.push_back(comps[i]);
		else xs.push_back(comps[i]);
	}
	auto solve = [](vector<int> &items, int goal) {
		bitset<MAX * 2 + 5> bs(0);
		bs[MAX] = 1;
		for(int x : items) {
			bitset<MAX * 2 + 5> now(0);
			now |= (bs << x);
			now |= (bs >> x);
			bs = now;
		}
		return bs[goal + MAX];
	};
	if(solve(xs, x) && solve(ys, y)) cout << "Yes";
	else cout << "No";
	return 0;
}


Measured memory_bytes: 384
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
using namespace std;
int main(void){
    int n,r,c1,c2;
    cin>>n;
    vector<int>a(n);
    for(int i=0;i<n;i++)cin>>a[i];
    sort(a.begin(),a.end());
    c1=*(lower_bound(a.begin(),a.end(),a[n-1]/2.0)-1);
    c2=*lower_bound(a.begin(),a.end(),a[n-1]/2.0);
    r=(fabs(c1-a[n-1]/2.0)<fabs(c2-a[n-1]/2.0)?c1:c2);
    if(a[n-1]==r)r=a[0];
    cout<<a[n-1]<<" "<<r<<endl;
    return 0;
}

Measured memory_bytes: 640
/*
 		Resilience is the greatest of all virtues.
 		Code by rajiv
 */
 #include <iostream>
 #include <cstring>
 #include <vector>
 #include <map>
 #include <set>
 #include <stack>
 #include <queue>
 #include <deque>
 #include <sstream>
 #include <iomanip>
 #include <cassert>
 #include <sys/time.h>
 #include <algorithm>
 #include <bitset>
 #include <cmath>
 #include <functional>
 #include <cmath>

 using namespace std ;

 #define xx first
 #define yy second
 #define ll long long
 #define ld long double
 #define el (char)0x0A
 #define sp " "
 #define pb push_back
 #define mp make_pair
 #define all(x) (x).begin(),(x).end()
 #define clr(x) memset((x),0,sizeof(x))
 #define uint unsigned int
 #define abs(x) ((x<=0)?(-x):(x))
 #define CASET  int t;cin>>t;while(t--)
 #define FORN(i,x,y) for(int i=x;i<y;i++)
 #define MAXN 100005
 #define INF 10000000010
 #define MOD 1000000007
 #define last_set_bit(x) log2((x)&(-x))
 #define add(x,y) (x)=((x)+(y))%MOD
 #define PI 3.141592653589793

 typedef pair<int,int> PII ; typedef vector<int> VI ; typedef vector<vector<int> > VVI ; typedef vector<bool> VB ; typedef vector<string> VS ;
 typedef map<int,int> MII ; typedef map<int,VI > MIV ; typedef set<int> SI ; typedef set<PII > SPII ; typedef vector<PII > VPII ; typedef vector<VPII > VVPII ;
 const int N = 200 ;
 int dp[2][N] ;
 int a[3][N] ;
 int n ;
 int main(){
 	ios_base::sync_with_stdio(false) ;
 	cin.tie(nullptr) ;
    cin >> n ;
    for(int i = 1 ; i <= 2 ; i++){
        for(int j = 1  ; j <= n ; j++){
            cin >> a[i][j] ;
        }
    }
    dp[1][1] = a[1][1] ;
    for(int i = 2 ; i <= n ; i++){
        dp[1][i] = dp[1][i-1]+a[1][i] ;
    }
    dp[2][n] = a[2][n] ;
    for(int i = n-1 ; i>=1 ; i--){
        dp[2][i] = dp[2][i+1]+a[2][i] ;
    }
    int ans = -(1<<29) ;
    for(int i = 1 ; i <= n ; i++){
        ans = max(ans,dp[1][i]+dp[2][i]) ;
    }
    cout << ans << el ;

 }


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	  public static void main(String[] args) {
	    Scanner sc = new Scanner(System.in);
	    String s = sc.next();
	    int num = 0;
	    for(int i = 0; i < s.length(); i++) {
	    	if("+".equals(s.substring(i, i+1))) {
	    		num++;
	    	} else {
	    		num--;
	    	}
	    }
	    System.out.println(num);
	}
}


Measured memory_bytes: 23252
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();

        System.out.println(solve(N));

        sc.close();
    }

    static String solve(int N) {
        StringBuilder result = new StringBuilder();
        while (N != 0) {
            if (N % 2 != 0) {
                result.append(1);
                --N;
            } else {
                result.append(0);
            }

            N /= -2;
        }

        result.reverse();
        if (result.length() == 0) {
            result.append(0);
        }

        return result.toString();
    }
}

Measured memory_bytes: 35644
#include <iostream>
#include <cmath>

int main() {
    int X;
    long double res=1;
    std::cin >> X;

    for (int n=2; n<X; n++) {
        int p=2;
        while ((long double) pow(n, p) <= X) {
            res = std::max( (long double) pow(n, p), res );
            p++;
        }
    }
    std::cout << (long long int) res << std::endl;
    return 0;
}


Measured memory_bytes: 512
// Title:
// URL: https://atcoder.jp/contests/abc118
#pragma region Library

#include <bits/stdc++.h>

using namespace std;

using ll = long long int;  // int_fast64_t;

template <class T>
using vt = vector<T>;
template <class T>
using vvt = vector<vector<T>>;
using vi = vt<int>;
using vvi = vvt<int>;
using vl = vt<ll>;
using vvl = vvt<ll>;

constexpr int INF = 1 << 30;   // 1073741824 2倍すると-2147483648
constexpr ll INFL = 1l << 62;  // 4611686018427387904 2倍すると-0.9*10^18
constexpr int dx4[] = {0, 1, 0, -1};
constexpr int dy4[] = {1, 0, -1, 0};
constexpr int dx8[] = {1, 0, -1, 0, 1, -1, -1, 1};
constexpr int dy8[] = {0, -1, 0, 1, -1, -1, 1, 1};
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define FORR(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define RANGE(i, a, b) for (int i = (a); i <= (b); i++)
#define RANGER(i, a, b) for (int i = (b); i >= (a); i--)
#define REP(i, n) FOR(i, 0, (n))
#define REPR(i, n) FORR(i, 0, (n))

#pragma endregion

int main() {
  int N;
  cin >> N;
  ll ans = 0;
  REP(i, N) {
    ll a;
    cin >> a;
    if (ans == 0)
      ans = a;
    else
      ans = __gcd(ans, a);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
import * as fs from 'fs'

const reader = (data: string) =>
  data
    .split('\n')
    .join(' ')
    .split(' ')
    .map(t => parseInt(t, 10))

function Main(input) {
  const [X] = reader(input)
  const num = Math.floor(X / 100)
  const hasuu = X % 100
  if (X < 100) {
    console.log('0')
  } else {
    console.log(hasuu < num * 5 + 1 ? '1' : '0')
  }
}

Main(fs.readFileSync('/dev/stdin', 'utf8'))


Measured memory_bytes: 7500
#include <stdio.h>

int main(void)
{
    int n;
    scanf("%d", &n);

    char s[11];
    int i, j, k;

    int c[5] = {};

    for (i = 0; i < n; i++) {
        scanf("%s", s);
        if (s[0] == 'M')
            c[0]++;
        else if (s[0] == 'A')
            c[1]++;
        else if (s[0] == 'R')
            c[2]++;
        else if (s[0] == 'C')
            c[3]++;
        else if (s[0] == 'H')
            c[4]++;
    }

    long sum = 0;
    for (i = 0; i < 5; i++) {
        for (j = i + 1; j < 5; j++) {
            if (i == j)
                continue;
            for (k = j + 1; k < 5; k++) {
                if (k == i || k == j)
                    continue;
                sum += c[i] * c[j] * c[k];
            }
        }
    }

    printf("%ld\n", sum);
    return 0;
}

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

// ----------- define --------------
#define int long long
#define vi vector<int>
#define vc vector<char>
#define ii pair<int,int>
#define fi first
#define sc second
#define all(x) (x).begin(),(x).end()
#define get_bit(x, k) ((x >> k) & 1)
// ---------------------------------

void MAIN() {
  int n; cin >> n;
  map<string, int> m;
  for (int i = 0; i < n; i++) {
    string s; cin >> s;
    sort(all(s));
    m[s]++;
  }
  int ans = 0;
  for (auto &i : m) {
    ans += i.sc * (i.sc - 1) / 2;
  }
  cout << ans << '\n';
}

signed main() {
  ios::sync_with_stdio(0); cin.tie(0);
  int T = 1;
  // cin >> T;
  while (T--) MAIN();
}


Measured memory_bytes: 11444
using System;
using System.Collections.Generic;
using System.Linq;
using static Input;

public class Prog
{
    private const int INF = 1000000007;
    private const long INFINITY = 9223372036854775807;
    private static int[] make_cost = { 0, 2, 5, 5, 4, 5, 6, 3, 7, 6 };
    public static void Main()
    {
        int N = NextInt();
        int[] A = new int[N];
        for (int i = 0; i < N; i++) A[i] = NextInt();

        Array.Sort(A);
        int[] a1 = new int[N];
        for (int i = 0; i < N - 1; i++)
        {
            a1[i] += (i % 2 == 0 ? 1 : -1);
            a1[i + 1] += (i % 2 == 0 ? -1 : 1);
        }

        int[] a2 = a1.Select(v => v * -1).ToArray();
        Array.Sort(a1);
        Array.Sort(a2);

        long ans1 = 0;
        for (int i = 0; i < N; i++) ans1 += a1[i] * A[i];

        long ans2 = 0;
        for (int i = 0; i < N; i++) ans2 += a2[i] * A[i];

        Console.WriteLine(Math.Max(ans1, ans2));
    }
}

public class Input
{
    private static Queue<string> q = new Queue<string>();
    private static void Confirm() { if (q.Count == 0) foreach (var s in Console.ReadLine().Split(' ')) q.Enqueue(s); }
    public static int NextInt() { Confirm(); return int.Parse(q.Dequeue()); }
    public static long NextLong() { Confirm(); return long.Parse(q.Dequeue()); }
    public static string NextString() { Confirm(); return q.Dequeue(); }
    public static double NextDouble() { Confirm(); return double.Parse(q.Dequeue()); }
    public static int[] LineInt() { return Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); }
    public static long[] LineLong() { return Console.ReadLine().Split(' ').Select(long.Parse).ToArray(); }
    public static string[] LineString() { return Console.ReadLine().Split(' ').ToArray(); }
    public static double[] LineDouble() { return Console.ReadLine().Split(' ').Select(double.Parse).ToArray(); }
}


Measured memory_bytes: 17492
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize ("Ofast")
#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
 
 
#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstring>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <valarray>
#include <iterator>
#include <functional>
#include <limits>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <cassert>
#include <unordered_map>
#include <unordered_set>
#include <stack>
using namespace std;
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
 
typedef int64_t ll;
 
#define endl '\n'
#define int ll
ll mod=1e9+7;
ll mod1=1e9+5;
ll power(ll a,ll b)
{
    if(b==0) return 1;
    else if(b%2==0)
        return power((((a%mod)*(a%mod))%mod),b/2)%mod;
    else return ((a%mod)*(power((((a%mod)*(a%mod))%mod),b/2)%mod))%mod;
}

 
int32_t main()
{
    IOS
    
        
        int a,b;
        cin>>a>>b;
        if(b<a)
            swap(a,b);
        if((a+b)%2)
        {
            cout<<"IMPOSSIBLE";
        }
        else
        {
            cout<<(a+b)/2;
        }


 
 
 
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class Program
{

    static void Main(string[] args)
    {
        int[] S = GetInputsInt();


        Console.Write(Math.Max(S[0] + S[1], Math.Max(S[0] - S[1], S[0] * S[1])));
    }



    public static int GetInputInt()
    {
        return int.Parse(Console.ReadLine());
    }
    public static int[] GetInputsInt()
    {
        return Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
    }
    public static List<int> GetInputsIntList()
    {
        return Console.ReadLine().Split(' ').Select(int.Parse).ToList();
    }
    public static long GetInputLong()
    {
        return long.Parse(Console.ReadLine());
    }
    public static long[] GetInputsLong()
    {
        return Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
    }

}


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

#pragma region Macro
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define SORT(v) sort(v.begin(), v.end())
#define pb(a) push_back(a)
#define eb(a) emplace_back(a)
#define vi vector<int>
#define vvi vector<vector<int>>
#define chmax(x,y) (x = max(x,y))
#define chmin(x,y) (x = min(x,y))

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

void solve(){
	#define int ll
	// ここに処理を記述
	// コンパイル時はエイリアス「gpp」--> c++17でコンパイル
	ll A;
	long double B;
	cin >> A >> B;
	cout << (ll)(A * B) << endl;
}

signed main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	
	solve();
	return 0;
}

Measured memory_bytes: 3748
def myAnswer(N:int,B:list) -> int:
   total = B[0]+B[-1]
   pre = B.pop(0)
   for b in B:
      total += min(pre,b)
      pre = b
   return total

def modelAnswer():
   tmp=1
def main():
   N = int(input())
   B = list(map(int,input().split()))

   print(myAnswer(N,B[:]))

if __name__ == '__main__':
   main()

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

#define faster     ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define read       freopen("input.txt", "r", stdin);
#define write      freopen("output.txt", "w", stdout);
#define endd        '\n'
#define ll         long long
#define sq(a)      ((a) * (a))

using namespace std;
int main()
{
      faster;
      double pi = 2 * acos(0.0);
      ll int n,i,t,j,k,m=0,b,c,d,p,q,r,x=250,y=10,z,count=0;
      cin>>n;
      ll int ara1[n],ara2[n],ara3[n],ara4[n];
      for(i=0;i<n;i++){
            cin>>ara1[i];
      }
      for(i=0;i<n;i++){
            cin>>ara2[i];
            m=ara1[i]-ara2[i];
            if(m>=0)count+=m;
      }
      cout<<count;
      return 0;
}
//Sheikh Tafsir Rahman
//CSE IUT

Measured memory_bytes: 3608
#include <atcoder/all>
using namespace atcoder;
#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
using P = pair<int, int>;
using PL = pair<lint, lint>;
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(int i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
#define ALL(a)  (a).begin(),(a).end()
constexpr int MOD = 1000000007;
constexpr lint B1 = 1532834020;
constexpr lint M1 = 2147482409;
constexpr lint B2 = 1388622299;
constexpr lint M2 = 2147478017;
constexpr int INF = 2147483647;
void yes(bool expr) {cout << (expr ? "Yes" : "No") << "\n";}
template<class T>void chmax(T &a, const T &b) { if (a<b) a=b; }
template<class T>void chmin(T &a, const T &b) { if (b<a) a=b; }
using mint = modint998244353;
struct S{mint v; int size;};
S op(S a, S b) {return S{a.v + b.v, a.size + b.size};}
S e() {return S{(mint)0, 0};}
struct F{mint b, c;};
S mapping(F f, S x) {return S{f.b * x.v + f.c * x.size, x.size};}
F composition(F f, F g) {return F{g.b * f.b, g.c * f.b + f.c};}
F id() {return F{1, 0};}
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int N, Q;
  cin >> N >> Q;
  vector<S> A(N);
  REP(i, N) {
    int a;
    cin >> a;
    A[i] = S{a, 1};
  }
  lazy_segtree<S, op, e, F, mapping, composition, id> seg(A);
  REP(q, Q) {
    int t, l, r;
    cin >> t >> l >> r;
    if(t == 0) {
      int b, c;
      cin >> b >> c;
      seg.apply(l, r, F{b, c});
    } else cout << seg.prod(l, r).v.val() << "\n";
  }
}

Measured memory_bytes: 19596
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Convert;
using static System.Math;

class Program
{
    class P
    {
        public int index;
        public List<int> ad;
        public int d;
        public P(int index)
        {
            this.index = index;
            ad = new List<int>();
        }
        public override string ToString()
        {
            var dd = index==0||d != 0 ? d : -1;
            return $"{index + 1} {dd}";
        }
    }
    static void Main(string[] args)
    {
        var num = ToInt32(ReadLine());
        var ps = new P[num];
        for(var i = 0; i < num; i++)
        {
            var input = Array.ConvertAll(ReadLine().Split(' '), int.Parse);
            ps[i] = new P(i);
            for(var j = 0; j < input[1]; j++)
            {
                ps[i].ad.Add(input[2 + j] - 1);
            }
        }
        var set = new HashSet<int>();
        set.Add(0);
        var queue = new Queue<int>();
        queue.Enqueue(0);
        while (queue.Count != 0)
        {
            var p = queue.Dequeue();
            foreach (var val in ps[p].ad)
            {
                if (!set.Contains(val))
                {
                    ps[val].d = ps[p].d + 1;
                    queue.Enqueue(val);
                    set.Add(val);
                }
            }
        }
            
        
        WriteLine(string.Join("\n", ps.Select(p => p.ToString())));
    }
    private const string ALFA = "abcdefghijklmnopqrstuvwxyz";
    private const int MOD = 1000000007;
}



Measured memory_bytes: 19088