akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <queue>
#include <stack>
#include <tuple>
#include <cmath>
#include <iomanip>
#include <map>
#include <cstring> //memset(dp,0,sizeof(dp))
#include <functional>
#include <cctype>
#include <locale>
#define ll long long
#define rep(i,n) for(int i=0;i<(n);i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define fi first
#define se second
#define pb push_back
#define ALL(a) (a).begin(),(a).end()
using namespace std;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
typedef pair<int,int> P;
typedef pair<long long,long long> Pll;
#define fout(num) cout << fixed << setprecision(20) << (num) << endl
//s[i]=tolower(s[i]); islower(s[i]); cout << tolower(s[i])はバグ
//vector<vector<ll>> dp(n,vector<ll>(n))
//exist x map o setconst ll MOD = 1e9+7;return fac[n]*(finv[k]*finv[n-k] % MOD) % MOD;

signed main(){
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    string ss; cin >> ss;
    int n=(int)ss.size();
    if(ss[n-1]=='1'){ cout<<-1<<endl; return 0; }
    string s=ss.substr(0,n-1);
    string t=s;
    reverse(ALL(t));
    if(s!=t||s[0]=='0'){ cout<<-1<<endl; return 0; }
    queue<int> q;
    int pre=0;
    rep(i,n-1){
        if(i!=0&&s[i]=='1'){
            cout<< i+1 << " " << pre+1 << endl;
            pre=i;
            while(!q.empty()){
                cout << i+1 << " " << q.front()+1 << endl;
                q.pop();
            }
        }
        if(s[i]=='0') q.push(i);
    }
    cout << n << " "  << pre+1 << endl;
    while(!q.empty()){
        cout << n << " " << q.front()+1 << endl;
        q.pop();
    }
    
}



Measured memory_bytes: 4056
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner std = new Scanner(System.in);
      	int n = std.nextInt();
      	if (n % 2 == 0){
          System.out.println(n);
        } else {
          System.out.println(n * 2);
        }
    }
}

Measured memory_bytes: 22740
import sys

ary=[]
for i in sys.stdin:
    ary.append(int(i))
m = max(ary)
prime=[1] * (m + 1)
prime[0] = prime[1] = 0
for i in range(2, int(m ** 0.5) + 1):
    if prime[i] == 1:
        for j in range(i*2, m + 1, i):
            prime[j] = 0
for i in range(len(ary)):
    print(sum(prime[:ary[i] + 1]))

Measured memory_bytes: 24184
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (n); i++)
#define MOD 1000000007
#define INF 1e9
#define All(x) (x).begin(), (x).end()
typedef long long ll;
using namespace std;

int main() {
  string s;
  cin >> s;
  if(s[s.size()-1]=='3'){
    cout << "bon" << endl;
  }else if(s[s.size()-1]=='0'||s[s.size()-1]=='1'||s[s.size()-1]=='6'||s[s.size()-1]=='8'){
    cout << "pon" << endl;
  }else{
    cout << "hon" << endl;
  }

  return 0;
}


Measured memory_bytes: 3596
#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;

struct stNode {
    int key;
    stNode *pParent;
    stNode *pLeft;
    stNode *pRight;
};

class BinaryTree
{
public :
    int key;

    BinaryTree(void) : m_pHead(NULL) {};
    void Insert(int key);
    bool Find(int key);
    void PrintInorder(void);
    void PrintPreorder(void);

private :
    stNode *m_pHead;
    void Inorder(stNode *pNode);
    void Preorder(stNode *pNode);
};

void BinaryTree::Insert(int key)
{
    stNode *pNode, *pFind;

    pNode = (stNode*)malloc(sizeof(stNode));
    pNode->key    = key;
    pNode->pLeft  = NULL;
    pNode->pRight = NULL;

    if (m_pHead != NULL) {
        pFind = m_pHead;
        for (;;) {
            if (key < pFind->key) {
                if (pFind->pLeft == NULL) {
                    pFind->pLeft = pNode;
                    break;
                }
                else {
                    pFind = pFind->pLeft;
                }
            }
            else {
                if (pFind->pRight == NULL) {
                    pFind->pRight = pNode;
                    break;
                }
                else {
                    pFind = pFind->pRight;
                }
            }
        }

        pNode->pParent = pFind;
    }
    else {
        m_pHead = pNode;
        pNode->pParent = NULL;
    }

    return;
}

bool BinaryTree::Find(int key)
{
    bool ret = false;
    stNode *pNode = m_pHead;

    while (pNode != NULL) {
        if (key == pNode->key) {
            ret = true;
            break;
        }
        else if (key < pNode->key) {
            pNode = pNode->pLeft;
        }
        else {
            pNode = pNode->pRight;
        }
    }

    return ret;
}

void BinaryTree::PrintInorder(void)
{
    Inorder(m_pHead);
    printf("\n");
    return;
}

void BinaryTree::PrintPreorder(void)
{
    Preorder(m_pHead);
    printf("\n");
    return;
}

void BinaryTree::Inorder(stNode *pNode)
{
    if (pNode != NULL) {
        Inorder(pNode->pLeft);
        printf(" %d", pNode->key);
        Inorder(pNode->pRight);
    }

    return;
}

void BinaryTree::Preorder(stNode *pNode)
{
    if (pNode != NULL) {
        printf(" %d", pNode->key);
        Preorder(pNode->pLeft);
        Preorder(pNode->pRight);
    }

    return;
}

int main(void)
{
    int  i;
    int  num;
    int  key;
    char order[10];
    BinaryTree bTree;
    bool ret;

    scanf("%d", &num);
    for (i = 0; i < num; i++) {
        scanf("%s", order);
        switch (order[0]) {
        case 'i' :
            scanf("%d", &key);
            bTree.Insert(key);
            break;
        case 'f' :
            scanf("%d", &key);
            ret = bTree.Find(key);
            if (ret == true) {
                printf("yes\n");
            }
            else {
                printf("no\n");
            }
            break;
        case 'p' :
            bTree.PrintInorder();
            bTree.PrintPreorder();
            break;
        default :
            break;
        }
    }
}

Measured memory_bytes: 19952
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef long double ld;
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ll, ll> LP;
typedef pair<ld, ld> LDP;
int a[1 << 17];
int main() {
	int n; cin >> n;
	int mi = n + 1; int ma = 0;
	rep(i, n) {
		cin >> a[i];
		mi = min(mi,a[i]);
		ma = max(ma, a[i]);
	}
	bool ans;
	if (ma - mi >= 2) {
		ans = false;
	}
	else if(ma==mi){
		if (ma==n-1||ma<=n/2)ans = true;
		else ans = false;
	}
	else {
		int cnt = 0;
		rep(i, n) {
			if (mi == a[i])cnt++;
		}
		int rest = n - cnt;
		if (ma >= cnt+1&&ma<=cnt+rest/2)ans = true;
		else ans = false;
	}
	if (ans)cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}


Measured memory_bytes: 640
#include <vector>
#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
	int V, E, s, t, d;

	cin >> V >> E;

	vector<vector<int> > M(V, vector<int>(V, 1 << 27));

	for (int i = 0; i < E; i++)
	{
		cin >> s >> t >> d;

		M[s][t] = d;
	}

	vector<vector<int> > dp(V, vector<int>(1 << V, 1 << 27));

	dp[0][0] = 0;

	for (int i = 0; i < V; i++)
	{
		for (int j = 0; j < V; j++)
		{
			for (int k = 0; k < (1 << V); k++)
			{
				for (int l = 0; l < V; l++)
				{
					if ((k / (1 << j)) % 2 == 1)
					{
						dp[j][k] = min(dp[j][k], dp[l][k - (1 << j)] + M[l][j]);
					}
				}
			}
		}
	}

	cout << (dp[0][(1 << V) - 1] != (1 << 27) ? dp[0][(1 << V) - 1] : -1) << endl;

	return 0;
}

// Time : O ( V ^ 3 * 2 ^ V ) = 110,592,000

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

int32_t main()
{
    int h, w, n;
    cin>>h>>w>>n;

    int x, y;
    int flag = 0;
    int cnt1= 0;
    int cnt2 = 0;
    for(x=0;x<=100;x++)
    {
        for(y=0;y<=100;y++)
        {
            if(w*x + h*y - x*y >= n)
            {
                flag = 1;
                cnt1= x+y;
                break;
            }
        }
        if(flag)
        {
            break;
        }
    }
    flag = 0;
    for(y=0;y<=100;y++)
    {
        for(x=0;x<=100;x++)
        {
            if(w*x + h*y - x*y >= n)
            {
                flag = 1;
                cnt2= x+y;
                break;
            }
        }
        if(flag)
        {
            break;
        }
    }
    cout<<min(cnt1, cnt2);
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
  char brock[100];
  int H, W, i, j, k, flag;
  int res[100];

  scanf("%d %d", &H, &W);
  
  for(i = 0; i < H; i++){
    flag = -1;
    scanf("%s", brock);
    for(j = 0; j < W; j++){
      if(brock[j] == 'c')
	flag = 0;
      else if(flag > -1)
	flag++;
   
      printf("%d", flag);
      if(j == W-1)
	printf("\n");
	else
	  printf(" ");   
    }
  }
  return 0;
}

Measured memory_bytes: 604
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <cstring>
#include <cctype>
#include <sstream>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <complex>
using namespace std;
#define REP(i,n) for(int i = 0; i < (int)n; i++)
#define FOR(i,a,b) for(int i = a; i < (int)b; i++)
#define pb push_back
#define mp make_pair
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef long long ll;
const int INF = 1<<28;
const ll MOD = 1000000007;

int main() {
	int dp[290] = {};
	dp[0] = 1;
	FOR(i, 1, 18)
		for(int j = i*i; j < 290; j++)
			dp[j] += dp[j-i*i];
	int n;
	while(cin >> n, n)
		cout << dp[n] << endl;

	return 0;
}

Measured memory_bytes: 1160
#include <iostream>
#include <algorithm>
#include<vector>
#include <utility>
#include <string>

using namespace std;

int main(){
  long long a,b,c,i,j,k,ans,mid=0;
  int n;
  string s;
  cin >> n >> c;
  ans = 0;
  long long x[n],v[n],cal_r[n+1]={},cal_l[n+1]={},best_r[n+1]={},best_l[n+1]={};
  cin >> x[0] >> v[0];
  for(i=1;i<n;i++){
    cin >> x[i] >> v[i];
  }
  long long walk_l[n+1]={},walk_r[n+1]={};
  for(i=0;i<n;i++){
    walk_r[i+1]=x[i];
    walk_l[i+1]=c-x[n-1-i];
  }
  for(i=0;i<n;i++){//右回りと左回りのカロリーの和
    cal_r[i+1]=cal_r[i]+v[i];
    cal_l[i+1]=cal_l[i]+v[n-1-i];
  }
  for(i=0;i<n;i++){
    best_r[i+1]=max(best_r[i],cal_r[i+1]-x[i]);
    best_l[i+1]=max(best_l[i],cal_l[i+1]-(c-x[n-1-i]));
  }
  for(i=0;i<=n;i++){
    long long left,right;
    right=cal_r[i]-2*walk_r[i]+best_l[n-i];
    left=cal_l[i]-2*walk_l[i]+best_r[n-i];
    ans=max({ans,right,left});
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 6528
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e3 + 5;
const int M = 2e4 + 5;

int a[N], b[N];
int dp[N][M];

int main()
{
    int h, n;
    cin >> h >> n;
    for(int i = 1; i <= n; ++i) 
        cin >> a[i] >> b[i];
    memset(dp, 0x3f, sizeof dp);
    dp[0][0] = 0;
    for(int i = 1; i <= n; ++i) {
        for(int j = 0; j <= h; ++j) {
            dp[i][j] = min(dp[i - 1][j], dp[i][max(0, j - a[i])] + b[i]);
        }
    }
    cout << dp[n][h] << endl;
    return 0;
}


Measured memory_bytes: 78848
#include <iostream>

int main(int argc, char const* argv[])
{
	int h, w;
	char output[3] = "#.";

	do {
		std::cin >> h >> w;
		for (size_t i = 0; i < h; i++)
		{
			for (size_t j = 0; j < w; j++)
			{
				if (i % 2  == 0)
					std::cout << output[j % 2];
				else
					std::cout << output[(j + 1) % 2];
			}
			std::cout <<  std::endl;
		}

		if(h != 0 && w != 0)
			std::cout <<  std::endl;
	} while(h != 0 && w != 0);

	return 0;
}

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

for k in range(N):
    for i in range(N):
        for j in range(N):
            if nums[i][j] > nums[i][k] + nums[k][j]:
                print(-1)
                exit()


max_cost = 0
for i in range(N):
    for j in range(i + 1, N):

        flag = True
        for k in range(N):
            if k == i or k == j:
                continue
            if nums[i][j] == nums[i][k] + nums[k][j]:
                flag = False
                break

        if flag:
            max_cost += nums[i][j]


print(max_cost)


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

int N;
int A[210];

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

    int res = 0;

    while(true)
    {
        bool exit_odd = false;
        for(int i = 0; i < N; i++)
        {
            if(A[i] %2 != 0)
            {
                exit_odd = true;
            }
        }

        if(exit_odd)
        {
            break;
        }

        for(int i = 0; i < N; i++)
        {
            A[i] /= 2;
        }
        ++res;
    }

    cout << res << endl;
    
}

Measured memory_bytes: 256
N = int(input())
A = list(map(int, input().split()))
Guusu = []


for i in range(len(A)):
    if A[i] % 2 == 0:
        Guusu.append(A[i])

judge = 0
for i in range(len(Guusu)):
    if Guusu[i] % 3 == 0 or Guusu[i] % 5 == 0:
        None
    else:
        judge = 1

if judge == 0:
    print('APPROVED')
else:
    print('DENIED')

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

#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
#define OP(m) cout << m << endl
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;

int main()
{
    double r, g;
    cin >> r >> g;
    OP(2 * g - r);
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main() {
	long long N, A, B;
	cin >> N >> A >> B;
	if (N == 1) {
		if (A == B) {
			cout << 1 << endl;
		}
		else {
			cout << 0 << endl;
		}
	}
	else if (A > B) {
		cout << 0 << endl;
	}
	else {
		cout << (N - 1)*B + A - A*(N - 1) - B + 1 << endl;
	}
	return 0;
}

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

int n,m;
vector<int> color(10005,0),indeg(10005,0);
vector<vector<int>> G(10005,vector<int>(0));
list<int> ans;

void bfs(int s){
    queue<int> Q;
    Q.push(s);
    color[s]=1;
    while(!Q.empty()){
        int u=Q.front();
        Q.pop();
        ans.push_back(u);
        for(int i=0;i<G[u].size();i++){
            int v=G[u][i];
            indeg[v]--;
            if(indeg[v]==0&&color[v]==0){
                color[v]=1;
                Q.push(v);
            }
        }
    }
}

void tsort(){
    for(int i=0;i<n;i++){
        for(int j=0;j<G[i].size();j++){
            indeg[G[i][j]]++;
        }
    }

    for(int i=0;i<n;i++){
        if(indeg[i]==0&&color[i]==0) bfs(i);
    }
}

int main(){
    int a,b;
    cin>>n>>m;
    for(int i=0;i<m;i++){
        cin>>a>>b;
        G[a].push_back(b);
    }
    
    tsort();

    for(auto i=ans.begin();i!=ans.end();i++){
        cout<<*i<<endl;
    }
}


Measured memory_bytes: 3880
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
typedef long long LL;
int main(){
	LL a,b;
	while(cin>>a,cin>>b){
	   LL c=a+b;
	   LL count=0;
	   while(c!=0){
	      c/=10;
	      count++;
	   }
           cout<<count<<endl;
        }
	return(0);
}

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

const int mn=1e5+7;

int main()
{
	int n,m;
	scanf("%d%d",&n,&m);
	for(int i=1;i*2<=m;++i) printf("%d %d\n",i,m-i+1);
	for(int i=1;i*2<=m+1;++i) printf("%d %d\n",m+i,2*m-i+2); 
}

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

typedef long long ll;

using namespace std;

int main(){
    int n;
    cin >> n;
    cout << n + pow(n, 2) + pow(n, 3) << endl;
}

Measured memory_bytes: 4188
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = (s); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) for(int i = (n); i >= 0; i--)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << '\n';
#define CFYN(n) cout << ( (n) ? "YES":"NO") << '\n';
#define OUT(n) cout << (n) << '\n';
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;

int main(void)
{
    IOS
    int a, b;
    cin >> a >> b;
    ATYN(a != 2 && b != 2)

    return 0;
}

Measured memory_bytes: 256
#!python3

iim = lambda: map(int, input().rstrip().split())

def resolve():
    A, B = iim()
    ans = 10 * B
    for i in range(ans, ans+10):
        if (8*i) // 100 == A:
            print(i)
            return
    print(-1)


if __name__ == "__main__":
    resolve()


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

typedef long l;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, string> pis;
typedef pair<long, long> pll;

#define EACH(t, c) for (auto&& t : c)
#define ALL(c) begin(c), end(c)
#define FOR(i, s, e) for (int i = (s); i < (int)(e); ++i)
#define REP(i, n) FOR(i, 0, n)
#define endl '\n'
#define F first
#define S second
#define pb push_back
#define mp make_pair

const int DX[] = {1, 0, -1, 0, 1, 1, -1, -1}, DY[] = {0, 1, 0, -1, 1, -1, 1, -1};
const int MOD = (int)1e9 + 7;
const int INF = 999999999;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int a[n];

  int ct = 0;
  REP(i, n) {
    cin >> a[i];
    while (a[i] % 2 == 0) {
      a[i] /= 2;
      ct++;
    }
  }

  cout << ct << endl;

}



Measured memory_bytes: 256
using System;
class Program
{
	static void Main(string[] args)
	{
		int n = int.Parse(Console.ReadLine());

		for (int s = 0; s < 10; s++)
		{
			for (int t = 0; t < 10; t++)
				{
					for (int u = 0; u < 10; u++)
					{
					  int number = u*100 + t*10 + s;
                      if (n == number)
						{
							if (s == 7 || t == 7 || u == 7)
								{
								Console.WriteLine("Yes");
								}
							else
								{
								Console.WriteLine("No");
								}
						}
					}
				}	
		}
	}
}

Measured memory_bytes: 27232
h,w,k=map(int,input().split())
MAP=[list(input()) for i in range(h)]
ans=[[0 for i in range(w)] for j in range(h)]
cnt=0
line=[]
for i in range(h):
    if "#" not in MAP[i]:
        line.append(i)
        continue
    start=cnt
    for j in range(w):
        if MAP[i][j]=="#" and cnt!=k:
            cnt +=1
            ans[i][j]=cnt
        else:
            if cnt==start:ans[i][j]=start+1
            else:ans[i][j]=cnt

ans.insert(0,["*"]*w)
ans.append(["*"]*w)
while len(line)!=0:
    for i in line:
        i=i+1
        if ans[i+1][0]!=0 and ans[i+1][0]!="*":
            ans[i]=ans[i+1]
            line.remove(i-1)
        elif ans[i-1][0]!=0 and ans[i-1][0]!="*":
            ans[i]=ans[i-1]
            line.remove(i-1)

for i in range(1,h+1):
    print(*ans[i])

Measured memory_bytes: 8272
#include <bits/stdc++.h>
using namespace std;
int main() {
  string a,week[]={"SUN","MON","TUE","WED","THU","FRI","SAT"};
  cin >>a;

  for(int i=0;i<7;i++){
     if(a==week[i]) cout << 7-i << endl;
  }
  
  return 0;
}

Measured memory_bytes: 256
a,b,c,d,e,f=map(int, input().split()) 
x=0
y=0
#ans1 水　ans2 砂糖
ans1=1
ans2=0
for i in range(31):
    for j in range(31):
        x=100*(a*i+b*j)
        if x>f:
            continue
        if x==0:
            continue
        
        for k in range(f//c+1):
            for l in range(f//(c+d)+1):
                y=c*k+d*l
                
                if x+y>f or y/(x+y)>e/(100+e):
                    continue
                
                else:
                    if y/(x+y)>=ans2/(ans1+ans2):
                        ans1=x
                        ans2=y
                    else:
                        continue
if x+y!=0:
    print(ans1+ans2,ans2)
else:
    print(a,0)
                    
                
                
        
    


Measured memory_bytes: 42860
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define MOD 1000000007
#define MOD2 998244353
#define INF ((1<<30)-1)
#define LINF (1LL<<60)
#define EPS (1e-10)
typedef long long Int;
typedef pair<Int, Int> P;

int main() {
    int n;
    cin >> n;
    vector<int> b(n);
    rep(i,n) cin >> b[i];
    vector<int> ans;
    while (b.size() > 0) {
        bool ok = false;
        for (int i = b.size() - 1; i >= 0; i--) {
            if (b[i] == i + 1) {
                ans.push_back(b[i]);
                b.erase(b.begin() + i);
                ok = true;       
                break;
            }
        }
        if (!ok) {
            cout << -1 << endl;
            return 0;
        }
    }
    reverse(ans.begin(), ans.end());
    rep(i,n) cout << ans[i] << endl;
}

Measured memory_bytes: 256
//#include <bits/stdc++.h>
#include <iostream>
#include <map>
#include <cmath>
#include <ios>
#include <iomanip>
#include <algorithm>
#include <queue>
#include <stack>
#include <numeric>
//#include <windows.h>
using namespace std;
template<class T> using V = vector<T>;
template<class T> using VV = V<V<T>>;
template<class T> using VVV = V<VV<T>>;
template<class T> using G = greater<T>;
template<class T1, class T2> using P = pair<T1, T2>;
using I = int;
using D = double;
using B = bool;
using C = char;
using S = string;
using LL = long long;
using LD = long double;
using ULL = unsigned long long;
using PII = P<I, I>;
using VPII = V<PII>;
using PLL = P<LL, LL>;
using VPLL = V<PLL>;
using VI = V<I>;
using VVI = VV<I>;
using VLL = V<LL>;
using VVLL = VV<LL>;
using VC = V<C>;
using VVC = VV<C>;
using VS = V<S>;
using VVS = VV<S>;
using VB = V<B>;
using VVB = VV<B>;
#define REP(type, i, n) for (type i = 0; i < (type)(n); ++i)
#define REP2(type, i, m, n) for (type i = (m); i < (type)(n); ++i)
#define REPR(type, i, n) for (type i = (n)-1; i >= 0; --i)
#define REPR2(type, i, m, n) for (type i = (n)-1; i >= (m); --i)
#define REPx(x, a) for(auto x : a)
#define ALL(a) a.begin(), a.end()
#define SORT(a) sort(ALL(a))
#define SORTR(a, type) sort(ALL(a), G<type>())
#define REVERSE(a) reverse(ALL(a))
#define SIZE(a, type) ((type)(a).size())
#define bit_search(bit, n) REP(LL, bit, 1LL<<(n))
#define bit_check(bit, i) ((bit>>(i)) & 1)
#define setpre(n) fixed << setprecision((n))
#define UNIQUE(a) do {SORT(a); (a).erase(unique(ALL(a)), (a).end());} while(0)
#define MAX(a) *max_element(ALL(a))
#define MIN(a) *min_element(ALL(a))
#define bisect_left(a, x) lower_bound(ALL(a), (x)) - a.begin()
#define bisect_right(a, x) upper_bound(ALL(a), (x)) - a.begin()
#define INPUT(a) REPx(&x, a) cin >> x;
#define INPUTP(a) REPx(&x, a) cin >> x.first >> x.second;
#define OUTPUT_PERMUTATION(n) do{VI v(n); iota(ALL(v), 1); do{REPx(x, v) cout << x << " "; ENDL} while(next_permutation(ALL(v)));} while(0);
#define MAKE_PERMUTATION(n, PER) do{VVI a(fact(n), VI(n)); int idx = 0; VI v(n); iota(ALL(v), 1); do{REP(roop, n) a[idx][roop] = v[roop]; idx++;} while(next_permutation(ALL(v))); PER = a;} while(0); // int fact(), VVI PERを宣言しておく、n=10が限界(500 ms)
#define ENDL cout << endl;

template<class T> using PRIORITY_QUEUE = priority_queue< T, V<T>, G<T> >;

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

const int INF = 2e9;
const LL MOD = 1e9 + 7;

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  string X, Y;
  cin >> X >> Y;
  int len_x = SIZE(X, int), len_y = SIZE(Y, int);
  VVI dp(len_x+1, VI(len_y+1, INF));
  dp[0][0] = 0;
  REP2(int, i, 1, len_x+1) dp[i][0] = i;
  REP2(int, j, 1, len_y+1) dp[0][j] = j;
  REP2(int, i, 1, len_x+1) REP2(int, j, 1, len_y+1)
  {
    chmin(dp[i][j], dp[i-1][j] + 1);
    chmin(dp[i][j], dp[i][j-1] + 1);
    chmin(dp[i][j], dp[i-1][j-1] + (int)(X[i-1]!=Y[j-1]));
  }
  cout << dp[len_x][len_y] << endl;

  return 0;
}


Measured memory_bytes: 6680
from itertools import product
n, m, x = map(int,input().split())
A = []
C = []
for i in range(n):
    a = list(map(int,input().split()))
    C.append(a[0])
    A.append(a[1:])

total = float('inf')
ok = False
for pr in product([0, 1], repeat=n):
    clct = 0
    for a in zip(*A):
        cnt = 0
        for i in range(n):
            if pr[i] == 1:
                cnt += a[i]
        if cnt >= x:
            clct += 1
    
    if clct == m:
        ok = True
        ttl = 0
        for c,p in zip(C, pr):
            if p == 1:
                ttl += c
        total = min(total, ttl)

if ok:
    print(total)
else:
    print(-1)

Measured memory_bytes: 9252
<?php
fscanf(STDIN, "%d %d", $N, $X);
$x = explode(" ", trim(fgets(STDIN)));
$x[] = $X;
rsort($x);
$x_min = min($x);
$x = array_map(function($a) use($x_min) {return $a - $x_min;}, $x);

for ($i = 1; $i <= $N; $i++) {
    if (!isset($ans)) {
        $ans = gcd($x[$i - 1], $x[$i]);
    } else {
        $ans = gcd($ans, $x[$i]);
    }
    if ($ans === 1) break;
}
echo $ans;

//最大公約数
function gcd($m, $n){
    if($n > $m) list($m, $n) = array($n, $m);
     
    while($n !== 0){
        $tmp_n = $n;
        $n = $m % $n;
        $m = $tmp_n;
    }
    return $m;
}


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

#define MAX 100000

typedef struct{
  char name[10];
  int t;
}Data;

typedef struct{
  int head;
  int tail;
  Data data[MAX];
}Queue;

void initqueue(Queue*);
int enqueue(Queue*, Data);
Data dequeue(Queue*);
//void dprint(Queue);

void initqueue(Queue *q){
  q->head = 0;
  q->tail = 0;
}

int enqueue(Queue *q, Data in){
  int i;
  if(q->tail < MAX){
    q->data[q->tail] = in;
    q->tail ++;
    if(q->tail >= MAX){
      for(i=q->head;i<q->tail;i++){
        q->data[i-q->head] = q->data[i];
      }
      q->tail = i-q->head;
      q->head = 0;
    }
    return 1;
  }
  return 0;
}

Data dequeue(Queue *q){
  Data out;
  if(q->tail >= 0 || q->head < q->tail){
    out = q->data[q->head];
    q->head ++;
    return out;
  }
  printf("DEQUEUE EROOR\n");
  return out;
}

int main(){
  int i, n, q, tcount=0;
  Queue Q;
  Data data;

  scanf("%d%d",&n,&q);
  initqueue(&Q);
  for(i=0;i<n;i++){
    scanf("%s %d",data.name, &data.t);
    enqueue(&Q, data);
  }

  while(n > 0){
    //dprint(Q);
    data = dequeue(&Q);
    if(data.t > q){
      data.t -= q;
      enqueue(&Q, data);
      tcount += q;
    } else {
      tcount += data.t;
      printf("%s %d\n",data.name, tcount);
      n--;
    }
  }

  /*for(i=0;i<n;i++){
    printf("%s %d\n",out[i].name, out[i].time);
  }*/

  //dprint(Q);
  return 0;
}


/*void dprint(Queue Q){
  int i, j;
  Data inp;
  for(i=0;i<Q.tail;i++){
    printf("%s %d\n",Q.data[i].name, Q.data[i].t);
  }
  printf("\n\n");
  if(0){
    for(j=0;j<Q.n;j++){
      inp = dequeue(&Q);
      printf("dequeue %s %d\n",inp.name, inp.t);
      for(i=0;i<Q.tail;i++){
        printf("%s %d\n",Q.data[i].name, Q.data[i].t);
      }
    }
  }
}
*/



Measured memory_bytes: 3256
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		String S = stdIn.next();
		char[] s = S.toCharArray();
		int n = S.length();
		long count = 0;
		
		if(s[0] == '<') {
			for(int i = 0; i < n;) {
				long temp1 = 1;
				while(i < n-1 && s[i] == s[i+1]) {
					temp1++;
					i++;
				}
				i++;
				long temp2 = 1;
				while(i < n-1 && s[i] == s[i+1]) {
					temp2++;
					i++;
				}
				i++;
				count += temp1*(temp1-1)/2+temp2*(temp2-1)/2+Math.max(temp1,temp2);
			}
		}
		else {
			int i = 0;
			long temp = 1;
			while(i < n-1 && s[i] == s[i+1]) {
				temp++;
				i++;
			}
			i++;
			count += temp*(temp+1)/2;
			for(; i < n;) {
				long temp1 = 1;
				while(i < n-1 && s[i] == s[i+1]) {
					temp1++;
					i++;
				}
				i++;
				long temp2 = 1;
				while(i < n-1 && s[i] == s[i+1]) {
					temp2++;
					i++;
				}
				i++;
				count += temp1*(temp1-1)/2+temp2*(temp2-1)/2+Math.max(temp1,temp2);
			}
		}
		System.out.println(count);

	}

}

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

using namespace std;

int main()
{
//    freopen("int.txt","r",stdin);

    int w,h;
    int x,y,r;
    while(cin>>w>>h>>x>>y>>r)
    {
        int ok=1;
        if(y+r>h||y-r<0)
            ok=0;
        if(x+r>w||x-r<0)
            ok=0;
        if(ok)
            cout<<"Yes"<<endl;
        else
            cout<<"No"<<endl;
    }
}



Measured memory_bytes: 3108
#include <stdio.h>
int main()
{
    long long int n;
    scanf("%lld",&n);
    long long int total = 0;
 
    for (int i = 1; i <= n; i++)
    {
        if (i % 3 == 0 || i % 5 == 0) 
		{
			continue;
		}
        else 
		{
			total += i;
		}
    }
    printf("%lld", total);
    return 0;
}

Measured memory_bytes: 1692
#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<cmath>
#include<iostream>
#define N 210000
#define M 4100
#define mmod 1000000007
using namespace std;
int f[M][M],n,a[N],b[N],o,ans,ny[2*M],jc[2*M];
void upd(int &x,int y)
{
	x=(x+y)%mmod;
}
int C(int n,int m)
{
	return 1ll*jc[n]*ny[m]%mmod*ny[n-m]%mmod;
}
int main()
{
	jc[0]=ny[0]=jc[1]=ny[1]=1;
	for(int i=2;i<2*M;i++) jc[i]=1ll*i*jc[i-1]%mmod,ny[i]=1ll*(-mmod/i)*ny[mmod%i]%mmod;
	for(int i=2;i<2*M;i++) ny[i]=1ll*ny[i]*ny[i-1]%mmod;
	scanf("%d",&n);
	for(int i=1;i<=n;i++) 
	{
		scanf("%d%d",&a[i],&b[i]);
		o=max(o,max(a[i],b[i]));
	}
	for(int i=1;i<=n;i++) f[o-a[i]][o-b[i]]++;
	for(int i=-o;i<=o;i++)
		for(int j=-o;j<=o;j++)
			upd(f[i+o][j+o+1],f[i+o][j+o]),upd(f[i+o+1][j+o],f[i+o][j+o]);
	for(int i=1;i<=n;i++) upd(ans,f[a[i]+o][b[i]+o]);
	for(int i=1;i<=n;i++) 
		upd(ans,-C(2*(a[i]+b[i]),a[i]+a[i]));
	int ny=(mmod+1)/2;
	ans=1ll*ans*ny%mmod;
	upd(ans,mmod);
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 65920
N,M = map(int,input().split())
AB = []
for i in range(N):
    A,B = map(int,input().split())
    AB.append((A,B))
AB.sort()
cnt = 0
ans = 0
for a,b in AB:
    if cnt+b >= M:
        break
    cnt += b
    ans += a*b
ans += a*(M-cnt)
print(ans)


Measured memory_bytes: 16908
#include<bits/stdc++.h>
#define ll long long
using namespace std;
#define pb push_back
const int ha=1e9+7,N=200005;

inline int add(int x,int y){ x+=y; return x>=ha?x-ha:x;}
inline void ADD(int &x,int y){ x+=y; if(x>=ha) x-=ha;}

inline int ksm(int x,int y){
	int an=1;
	for(;y;y>>=1,x=x*(ll)x%ha) if(y&1) an=an*(ll)x%ha;
	return an;
} 

inline int read(){
	int x=0; char ch=getchar();
	for(;!isdigit(ch);ch=getchar());
	for(;isdigit(ch);ch=getchar()) x=x*10+ch-'0';
	return x;
}

vector<int> g[N],now;
int dfn[N],dc,num[N],jc[N],ni[N],ans=1,sz;
int n,X,Y,col[N],w[N],mn[N],p[N],pos[2],C;
bool v[N];

inline void ae(int x,int y){ g[x].pb(y),g[y].pb(x);}

inline void init(){
	// prepare n! and (n!)^(-1)
	jc[0]=1;
	for(int i=1;i<=n;i++) jc[i]=jc[i-1]*(ll)i%ha;
	ni[n]=ksm(jc[n],ha-2);
	for(int i=n;i;i--) ni[i-1]=ni[i]*(ll)i%ha;
	
	// prepare edges between different colors
	for(int i=1;i<=n;i++)
	    if(mn[i]<mn[pos[0]]) pos[1]=pos[0],pos[0]=i;
		else if(mn[i]<mn[pos[1]]) pos[1]=i;
	pos[0]=p[pos[0]],pos[1]=p[pos[1]];
	
	int yz=Y-w[pos[0]],yo=Y-w[pos[1]],cx=col[pos[0]],cy=col[pos[1]];
	
	for(int i=1;i<=n;i++){
		C=col[i];
		if(C!=cx&&w[i]<=yz) ae(i,pos[0]);
		if(C!=cy&&w[i]<=yo) ae(i,pos[1]);		
	}
	
	// prepare edges between the same colors
	for(int i=1;i<=n;i++){
		C=col[i];
	    if(i!=p[C]&&w[i]+w[p[C]]<=X) ae(i,p[C]);
	}
}

void dfs(int x){
	v[x]=1,sz++,C=col[x];
	if(dfn[C]!=dc) dfn[C]=dc,now.pb(C),num[C]=1;
	else num[C]++;
	
	for(int i:g[x]) if(!v[i]) dfs(i);
}

inline void solve(){
	// calculate
	for(int i=1;i<=n;i++) if(!v[i]){
		dc++,now.clear(),sz=0;
		dfs(i),ans=ans*(ll)jc[sz]%ha;
		for(int j:now) ans=ans*(ll)ni[num[j]]%ha;
	}
}

int main(){
	memset(mn,0x3f,sizeof(mn)),w[0]=1e9+233;
	
	n=read(),X=read(),Y=read();
	for(int i=1;i<=n;i++){
		C=col[i]=read(),w[i]=read();
		if(w[i]<mn[C]) mn[C]=w[i],p[C]=i;
	}
	
	init(),solve();
	
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 19304
#include<bits/stdc++.h>
using namespace std;
long long dfs(long long a,long long b){
  long long ans=0;
  if (a%b != 0){
    ans += (a/b) * 2 * b;
    ans += dfs(b,a%b);
  }else{ans += ((a/b) * 2 * b) - b;}
  //cout<<"a"<<a<<"b"<<b<<"ans"<<ans<<"\n";
  return ans;
}
int main()
{
  long long n,x;
  cin >>n>>x;
  long long ans=0;
  ans = n + dfs(max(n-x,x),min(n-x,x));
  cout<<ans;
}


Measured memory_bytes: 256
N=int(input())
A=[list(map(int,input().split())) for i in range(N)]
from collections import defaultdict
d=defaultdict(int)
l=defaultdict(list)
for i in range(N):
    x,y=(i,A[i][0]-1) if i<A[i][0]-1 else (A[i][0]-1,i)
    d[(x,y)]+=1
    l[(x,y)].append(i)
p=[0]*N
r=0
cand=list(d.keys())
while len(d)>0:
    r+=1
    f=0
    diff=defaultdict(int)
    for k in cand:
        if d[k]==2:
            del d[k]
            for i in l[k]:
                p[i]+=1
                if p[i]>N-2:
                    continue
                x,y=(i,A[i][p[i]]-1) if i<A[i][p[i]]-1 else (A[i][p[i]]-1,i)
                diff[(x,y)]+=1
                l[(x,y)].append(i)
            f=1
    for x,y in diff.keys():
        d[(x,y)]+=diff[(x,y)]
    cand=diff.keys()
    if f==0:
        break
print(r if f>0 else -1)

Measured memory_bytes: 148692
num1, num2 = map(int, input().split())

import math
def gcd(num1, num2):
  for i in range(min(num1, num2),0,-1):
    if num1%i==0 and num2%i==0:
      return i
    
print(int(num1*num2/gcd(num1,num2)))

Measured memory_bytes: 3060
n = int(input())
a = list(map(int,input().split()))
a = sorted(a)
res = 0
for i in range(n):
    for j in range(i + 1, n):
        for k in range(j + 1, n):
            if len(list(set([a[i], a[j], a[k]]))) < 3:
                continue
            if a[i] + a[j] <= a[k]:
                continue
            res += 1
print(res)

Measured memory_bytes: 68192
#include<iostream>
#include<string>
#include<vector>

using namespace std;

typedef long long ll;

int main() {
	ll N;
	cin >> N;
	if (N % 2 == 1) {
		cout << 0 << endl;
	}
	else {
		//*0の数を数える
		ll ans = 0;
		while (N > 0) {
			ans += (N / 10LL);
			N /= 5LL;
		}
		cout << ans << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <unordered_map>
#include <vector>
#include <map>
#include <list>
#include <queue>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <stack>
#include <set>
#include <bitset>
#include <deque>
#pragma GCC optimize(3 , "Ofast" , "inline")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
using namespace std ;
#define ios ios::sync_with_stdio(false) , cin.tie(0) , cout.tie(0)
#define x first
#define y second
#define pb push_back
#define ls rt << 1
#define rs rt << 1 | 1
typedef long long ll ;
const double esp = 1e-6 , pi = acos(-1) ;
typedef pair<int , int> PII ;
const int N = 1e6 + 10 , INF = 0x3f3f3f3f , mod = 1e9 + 7;
ll dp[3100] ;
int work()
{
  int s ;
  cin >> s ;
  dp[0] = 1 ;
  for(int i = 3 ; i <= s ; i ++ ) {
    for(int j = 3 ; j <= s ;j ++ )
      if(i >= j)
       ( dp[i] += dp[i - j] ) %= mod ;
  }
  cout << dp[s] << endl ;
  return 0 ;
}
int main()
{
  //   freopen("C://Users//spnooyseed//Desktop//in.txt" , "r" , stdin) ;
  //   freopen("C://Users//spnooyseed//Desktop//out.txt" , "w" , stdout) ;

  work() ;
  return 0 ;
}
/*
*/


Measured memory_bytes: 3200
#include <bits/stdc++.h>
using namespace std;
using lint = long long int;

int D;

// べき乗
lint power(lint x, int n)
{
    lint ans = 1;
    while (n>0)
    {
        if (n & 1) ans = ans * x;
        x = x * x;
        n >>= 1;
    }
    return ans;
}

vector<int> bfs(lint digit, lint n_remain)
{
    if (digit <= 0) return vector<int>(0);
    if (digit == 1 && n_remain == 0) return vector<int>(1, 0);
    lint MOD = power(10LL, digit-1) - 1;

    // cout << digit << " " << n_remain << " " << MOD << endl;
    for (int i=-9; i<=9; i++)
    {
        lint tmp = (n_remain - i * MOD); 
        if (tmp % 10 == 0 && abs(tmp) < MOD)
        {
            vector<int> res = bfs(digit-2, tmp/10);
            res.push_back(i);
            return res;
        }
    }
    return vector<int>(1, -100);
}

int main()
{
    cin >> D;
    lint ans = 0;
    for (int n=2; n<=18; n++)
    {
        // n桁の場合
        vector<int> digits = bfs(n, D);
        digits.back()++;
        lint tmp = 1;
        for (auto v : digits) 
        {
            tmp *= 10-abs(v);
            if (abs(v) > 9) tmp *= 0;
        }
        ans += tmp;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
package main

import (
	"fmt"
)

func main() {
	var h, w int
	fmt.Scan(&h, &w)
	cs := make([]string, h)
	for i := range cs {
		fmt.Scan(&cs[i])
	}

	for _, c := range cs {
		fmt.Println(c)
		fmt.Println(c)
	}
}


Measured memory_bytes: 1852
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
#define x first
#define y second
#define pb push_back
#define len(x) x.size()
#define all(x) x.begin(), x.end()

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

	string S, T;
	cin >> S >> T;
	if (len(S) != len(T)-1) {
		cout << "No\n";
		return 0;
	}
	bool bad = false;
	for (int i = 0; i < len(S); i++) {
		if (S[i] != T[i]) bad = true;
	}
	if (bad) {
		cout << "No\n";
		return 0;
	}
	cout << "Yes\n";
}


Measured memory_bytes: 3648
#include<iostream>

using namespace std;
int main() {
	int n,d[2];
	int num = 0,t = 0;
	cin >> n;
	if (n >= 3&&n<=100) {
		for (int i = 0; i < n; i++) {
			cin >> d[0] >> d[1];
			if (d[0] == d[1])num++;
			else num = 0;
			if (num >= 3)t = 1;
		}
		if (t)cout << "Yes" ;
		else cout << "No" ;
	}

	return 0;
}

Measured memory_bytes: 3636
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public final class Main {

    public static void main(String[] args) {
        final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        final String line = in.nextLine();
        System.out.println(line.replace("?", "D"));
    }
}


Measured memory_bytes: 41360
#include "bits/stdc++.h"
using namespace std;

int main() {
	int N, K, count = 0;
	cin >> N >> K;
	for (int i = 0; i <= 4; i++) {
		int R = 0;
		for (int j = 0; j <= 10; j++) {
			if ((7 * j + i + 9) % 11 == (5 * K) % 11) R = j;
		}
		if ((N - 3) % 11 < R) count += (N - 3) / 11;
		else count += (N - 3) / 11 + 1;
	}
	cout << count << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		double r =  sc.nextDouble();
		double pi = Math.PI;
		double area = Math.pow(r, 2) * pi; // ??¢???
		double Cir =2 * pi * r; //Circumference ?????¨
		System.out.printf("%.5f %.5f\n",area,Cir);
	}
}

Measured memory_bytes: 28128
/*
AtCoder Beginner Contest 096 B - Maximum Sum 結果:

*/

//#include<stdio.h>
//#include<string.h>
//#include<math.h>
//#include<stdlib.h>

//#define DEBUG1
//#define DEBUG2
//#define DEBUGF
//
//#ifdef DEBUG1
//#ifdef DEBUG2
//#ifdef DEBUGF
//#endif
//#define int long long

#include<stdio.h>
#include<math.h>
#include<stdlib.h>

int desc(const void *a, const void *b) {
	return *(int *)b - *(int *)a;
}

int main(void) {
	int num[3];
	int k;
	scanf("%d %d %d", &num[0], &num[1], &num[2]);
	scanf("%d", &k);
	qsort(num, 3, sizeof(int), desc);
	int a = pow(2, k);
	printf("%d\n", num[0] * a + num[1] + num[2]);
#ifdef DEBUGF
	getch();
#endif
	return 0;
}

//a = (int)sqrt((double)n) + 1;
//int ngflg = 0;
//scanf("%d", &n);
//scanf("%lld", &N);
//
//#define int long long
//signed main() {
//int *x = (int *)malloc(sizeof(int) * N);
//int *y = (int *)malloc(sizeof(int) * N);
//int desc(const void *a, const void *b) {return *(int *)b - *(int *)a;}
//qsort(num, 3, sizeof(int), desc);
//int d = pow(2, k);


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

int main(){
  int n, m;
  int sum = 0;
  cin >> n >> m;
  sum += (n - m) * 100 + 1900 * m;
  for(int i = 0; i < m; i++) sum *= 2;
  cout << sum << '\n';
  return 0;
}


Measured memory_bytes: 256
import itertools
n,m,q=map(int,input().split())
a=[]
for _ in range(q):
  b=list(map(int,input().split()))
  a.append(b)
  
g=list(range(1,m+1))
c=[]
for v in itertools.combinations_with_replacement(g,n):
  c.append(v)
  
ans1=[]
ans=0
for x in range(len(c)):
  d=c[x]
  ans1=0
  for r in range(q):
    a1=a[r][0]-1
    b1=a[r][1]-1
    c1=a[r][2]
    d1=a[r][3]
    if d[b1]-d[a1]==c1:
      ans1+=d1
      
  ans=max(ans,ans1)
  
print(ans)
    
    




Measured memory_bytes: 21780
S = input()
if S.count(S[0]) != 4:
    if S[0] == S[1] and S[2] == S[3]:
        print("Yes")
        exit()
    if S[0] == S[2] and S[1] == S[3]:
        print("Yes")
        exit()
    if S[0] == S[3] and S[1] == S[2]:
        print("Yes")
        exit()
print("No")

Measured memory_bytes: 3060
/*
	submission # - User: herp_sy
	https://atcoder.jp/contests/

	coding: utf-8
	lang: C (GCC 5.4.1)
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <stdbool.h>

#define _CRT_SECURE_NO_WARNINGS
#define TLong long long
#define TBMod 1000000007

int main(int argc, char const *argv[])
{
	int n;
	scanf("%d", &n);
	printf("%.8f\n", (double)(n - n / 2) / (double)n);
	return 0;
}


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

int main(){
  int N;
  cin >> N;
  int A[100];
  for (int i=0;i<N;i++){
    cin >> A[i];
  }
  int tmp1;
  int tmp2;
  int s = 0;
  for (int i=0;i<N;i++){
    for (int j=N-1;j>i;j--){
      if (A[j] < A[j-1]){
        tmp1 = A[j];
        tmp2 = A[j-1];
        A[j] = tmp2;
        A[j-1] = tmp1;
        s += 1;
      }
    }
  }
  for (int i=0;i<N;i++){
    cout << A[i];
    if (i<N-1){
      cout << " ";
    }else{
      cout << endl;
    }
  }
  cout << s << endl;
}



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

int main()
{
	set<int> s;
	int t;
	for(int i=0;i<6;i++)
	{
		cin>>t;
		if(!s.count(t)) s.insert(t);
		else s.erase(t);
	}
	if(s.size()==0 || s.size()==2) cout<<"YES\n";
	else cout<<"NO\n";
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdlib>
//#include <vector>
using namespace std;
struct Node{
    int key;
    Node *l,*r;
};
//vector<int>p;
Node *T;
//int isn;
void insert(Node *z){

    if(T==NULL)
    {
        T=z;
        //cout<<T->key<<endl;
        return;
    }

    Node *p,*temp=T;
    while(temp!=NULL)
    {
        p=temp;
        if(z->key<temp->key)
            temp=temp->l;
        else
            temp=temp->r;
    }
    if(z->key<p->key)
        p->l=z;
    else
        p->r=z;
}
void preOrder(Node *T){
    if(T==NULL){
        //cout<<1<<endl;
        return;
    }
    cout<<' '<<T->key;
    preOrder(T->l);
    preOrder(T->r);
}
void inOrder(Node *T){
    if(T==NULL)return;
    inOrder(T->l);
    cout<<' '<<T->key;
    inOrder(T->r);
}
void find(int x){
    Node *temp=T;
    while(temp!=NULL){
        if(x<temp->key)
            temp=temp->l;
        else if(x>temp->key)
            temp=temp->r;
        else
        {
            cout<<"yes"<<endl;
            return;
        }
    }
    cout<<"no"<<endl;
}
int main(){
    int m,key;
    char com[20];
    T=NULL;
    //isn=0;
    cin>>m;
    for(int i=0;i<m;i++)
    {
        cin>>com;
        if(com[0]=='i')
        {
            cin>>key;
            Node *z=(Node* )malloc(sizeof(Node));
            z->key=key;
            z->l=NULL;
            z->r=NULL;
            insert(z);
            //cout<<1;
        }
        else if(com[0]=='p')
        {
            inOrder(T);
            cout<<endl;
            preOrder(T);
            cout<<endl;

        }
        else
        {
            cin>>key;
            find(key);
        }
    }
    return 0;
}


Measured memory_bytes: 15492
n, m = list(map(int, input().split()))
sc = {}
for i in range(m):
    si, ci = list(map(int, input().split()))
    if (si in sc and sc[si] !=ci) or (n > 1 and si == 1 and ci == 0):
        print(-1)
        exit()
    sc[si] = ci

if n > 1:
    d = [1] + [0] * (n-1)
else:
    d = [0]

for si, ci in sc.items():
    d[si-1] = ci

s = ""
for c in d:
    s += str(c)
print(s)


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

using namespace std;

int main()
{
	char b;
	cin >> b;
	switch (b)
	{
	case 'A':
		cout << 'T';
		break;
	case 'T':
		cout << 'A';
		break;
	case 'C':
		cout << 'G';
		break;
	case 'G':
		cout << 'C';
		break;
	default:
		break;
	}
	cout << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
    int N, D, cnt = 0; cin >> N >> D;
    for (int i = 0; i < N; i++) {
        int x, y; cin >> x >> y;
        if (D >= sqrt(pow(x, 2) + pow(y, 2))) cnt++;
    }
    cout << cnt << endl;
}


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

int main()
{
    int N;
    int K;
    int number = 1;
    cin >> N;
    cin >> K;
    for(int i = 0;i < N;i++)
    {
        if(number * 2 > number + K)
        {
            number += K;
        }
        else
        {
            number *= 2;
        }
    }

    cout << number << endl;
    return 0;

}

Measured memory_bytes: 256
import java.util.Scanner;

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

    public static void solve(Scanner sc) {
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] count = new int[n];
        for (int i = 0; i < m; i++) {
            int a1 = sc.nextInt() - 1;
            int a2 = sc.nextInt() - 1;
            count[a1]++;
            count[a2]++;
        }
        
        for (int a : count) {
            System.out.println(a);
        }
    }
}

Measured memory_bytes: 21332
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
#define ll          long long
#define pb          push_back
#define INF         9223372036854775807
#define    endl        '\n'
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define hell        1000000007
#define rep(i,a,b)    for(ll int i=a;i<b;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define lower(u)    transform(u.begin(), u.end(), u.begin(), ::tolower);//convert string u to lowercase;
#define upper(u)    transform(u.begin(), u.end(), u.begin(), ::toupper);
#define time        cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
using namespace std;

using namespace __gnu_pbds; 
  
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
#define N  100005

void solve()
{
    ll n;
    cin>>n;
    ll ans=0;
    ll c=0;
    rep(i,0,n)
    {
        ll x,y;
        cin>>x>>y;
        if(x==y)
        {
            c++;
        }
        else
        {
            ans=max(ans,c);
            c=0;
        }
    }
    ans=max(ans,c);
    if(ans>=3)
    {
        cout<<"Yes"<<endl;
    }
    else
    {
        cout<<"No"<<endl;
    }
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int TESTS=1;
//    cin>>TESTS;
    while(TESTS--)
    {
        solve();
    }
    time
    return 0;
}

Measured memory_bytes: 3612