buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; if (b % 2 != 0) { cout << "NO" << endl; } else { if (b / 2 < a || b > (a * 4)) cout << "NO" << endl; else cout << "YES" << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; if (b % 2 != 0) { cout << "No" << endl; } else { if (b / 2 < a || b > (a * 4)) cout << "No" << endl; else cout << "Yes" << endl; } return 0; }
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
80
X, Y = map(int, input().split()) for i in range(X+1): if (2*i + 4*(X - i)) == Y: print("Yes") break else: print("No") break
X, Y = map(int, input().split()) for i in range(X+1): if (2*i + 4*(X - i)) == Y: print("Yes") break else: print("No")
[["-", 0, 57, 75, 76, 8, 196, 0, 93, 0, 94]]
5
59
x,y=map(int,input().strip().split()) if x*4<y and x*2<y: print("No") elif y%2!=0: print("No") else: print("Yes")
x,y=map(int,input().strip().split()) if x*4<y or x*2>y: print("No") elif y%2!=0: print("No") else: print("Yes")
[["-", 36, 36, 0, 656, 0, 57, 15, 679, 17, 355], ["+", 36, 36, 0, 656, 0, 57, 15, 679, 17, 354], ["-", 0, 656, 0, 57, 15, 679, 12, 666, 667, 18], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 667, 47]]
5
60
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; typedef pair<int, int> P; int main() { int x, y; cin >> x >> y; if (((4 * x - y) >= 0 && (4 * x - y) % 2 == 0) && (((-2) * x + y) % 2 >= 0 && ((-2) * x + y) % 2 == 0)) cout << "Yes" << en...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; typedef pair<int, int> P; int main() { int x, y; cin >> x >> y; if (((4 * x - y) >= 0 && (4 * x - y) % 2 == 0) && (((-2) * x + y) >= 0 && ((-2) * x + y) % 2 == 0)) cout << "Yes" << endl; ...
[["-", 12, 23, 0, 16, 31, 16, 31, 16, 17, 109], ["-", 12, 23, 0, 16, 31, 16, 31, 16, 12, 13]]
1
121
x,y=map(int,input().split()) for i in range(x+1): if i*2+(x-i)*4==y: print("Yes") print("No")
x,y=map(int,input().split()) for i in range(x+1): if i*2+(x-i)*4==y: print("Yes") exit() print("No")
[["+", 0, 57, 64, 196, 0, 1, 0, 652, 63, 22], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
53
#include <iostream> using namespace std; int main(void) { int X, Y; int XX, YY, a, b; cin >> X >> Y; XX = X * 2; YY = Y / 2; a = XX - YY; b = YY - X; // cout << a << " " << b << endl; if (a > 0 && b > 0 && X == a + b && Y == 2 * a + 4 * b) cout << "Yes" << endl; else cout << "No" << e...
#include <iostream> using namespace std; int main(void) { int X, Y; int XX, YY, a, b; cin >> X >> Y; XX = X * 2; YY = Y / 2; a = XX - YY; b = YY - X; if (a >= 0 && b >= 0 && X == a + b && Y == 2 * a + 4 * b) cout << "Yes" << endl; else cout << "No" << endl; return 0; }
[["-", 51, 16, 31, 16, 31, 16, 31, 16, 17, 47], ["+", 51, 16, 31, 16, 31, 16, 31, 16, 17, 20], ["-", 51, 16, 31, 16, 31, 16, 12, 16, 17, 47], ["+", 51, 16, 31, 16, 31, 16, 12, 16, 17, 20]]
1
104
X, Y = map(int, input().split()) add = 0 flag =0 for i in range(X): add = i*4 + (X-i)*2 if add == Y: print('Yes') flag = 1 break if flag == 0: print('No')
X, Y = map(int, input().split()) add = 0 flag =0 for i in range(X+1): add = i*4 + (X-i)*2 if add == Y: print('Yes') flag = 1 break if flag == 0: print('No')
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
69
#include <bits/stdc++.h> using namespace std; int main() { int x, y, i; cin >> x >> y; int legs = 0, cl = 0, tl = 0, c = 0, t = 0; for (i = 0; i <= x; i++) { c = i; t = x - i; cl = 2 * c; tl = 4 * t; legs = cl + tl; if (legs == y) { cout << "YES" << "\n"; return 0...
#include <bits/stdc++.h> using namespace std; int main() { int x, y, i; cin >> x >> y; int legs = 0, cl = 0, tl = 0, c = 0, t = 0; for (i = 0; i <= x; i++) { c = i; t = x - i; cl = 2 * c; tl = 4 * t; legs = cl + tl; if (legs == y) { cout << "Yes" << "\n"; return 0...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
120
x, y = gets.split(" ").map(&:to_i) a = x*2 - y/2 b = x - a if b >= 0 && a >= 0 && (b * 2) % 2 == 0 && (b * 2) % 2 == 0 && y % 2 == 0 puts "yes" else puts "no" end
x, y = gets.split(" ").map(&:to_i) a = x*2 - y/2 b = x - a if b >= 0 && a >= 0 && (b * 2) % 2 == 0 && (b * 2) % 2 == 0 && y % 2 == 0 puts "Yes" else puts "No" end
[["-", 64, 749, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 64, 749, 0, 652, 3, 4, 0, 557, 0, 6], ["-", 75, 95, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 75, 95, 0, 652, 3, 4, 0, 557, 0, 6]]
4
76
#include <iostream> using namespace std; int main(void) { int a, b; // Your code here! cin >> a >> b; if (b % 2 != 0 || b < a || b > 2 * a) { printf("No\n"); } else { printf("Yes\n"); } }
#include <iostream> using namespace std; int main(void) { int a, b; // Your code here! cin >> a >> b; if (b % 2 != 0 || b < 2 * a || b > 4 * a) { printf("No\n"); } else { printf("Yes\n"); } }
[["+", 51, 16, 31, 16, 12, 16, 12, 16, 31, 13], ["+", 51, 16, 31, 16, 12, 16, 12, 16, 17, 48], ["-", 15, 339, 51, 16, 12, 16, 12, 16, 31, 13], ["+", 15, 339, 51, 16, 12, 16, 12, 16, 31, 13]]
1
64
function Main(input) { // tmp[0]にX, tmp[1]にY input = input.split("\n"); tmp = input[0].split(" "); var x = parseInt(tmp[0], 10); var y = parseInt(tmp[1], 10); var b = 0; for (let t = 0; t < (x + 1); t++) { var yy = 4 * x - 2 * t; if (yy == y) { console.log('yes'); var b = 1; br...
function Main(input) { // tmp[0]にX, tmp[1]にY input = input.split("\n"); tmp = input[0].split(" "); var x = parseInt(tmp[0], 10); var y = parseInt(tmp[1], 10); var b = 0; for (let t = 0; t < (x + 1); t++) { var yy = 4 * x - 2 * t; if (yy == y) { console.log('Yes'); var b = 1; br...
[["-", 0, 1, 0, 2, 3, 3, 0, 557, 0, 491], ["+", 0, 1, 0, 2, 3, 3, 0, 557, 0, 491]]
2
158
a = list(map(int,input().split())) if a[1] % 2 == 1 : print("NO") else : if a[0] * 2 <= a[1] and a[0]*4 >= a[1] : print("YES") else : print("NO")
a = list(map(int,input().split())) if a[1] % 2 == 1 : print("No") else : if a[0] * 2 <= a[1] and a[0]*4 >= a[1] : print("Yes") else : print("No")
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
74
X,Y= map(int,input().split()) x = 2*X-Y//2 y = Y//2-X if Y%2 ==1: print("No") elif x>=0 and y>=0: print("Yes") else: print("Yes")
X,Y= map(int,input().split()) x = 2*X-Y//2 y = Y//2-X if Y%2 ==1: print("No") elif x>=0 and y>=0: print("Yes") else: print("No")
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
68
#include <bits/stdc++.h> using namespace std; int main() { int a, b, j = 0, c; cin >> a >> b; for (int i = 0; i <= a; i++) { c = i * 2 + (a - i) * 4; if (c == b) j = 1; } if (j == 0) cout << "NO"; else cout << "YES"; }
#include <bits/stdc++.h> using namespace std; int main() { int a, b, j = 0, c; cin >> a >> b; for (int i = 0; i <= a; i++) { c = i * 2 + (a - i) * 4; if (c == b) j = 1; } if (j == 0) cout << "No"; else cout << "Yes"; }
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
88
X, Y = map(int, input().split()) if Y % 2 != 0: print("No") exit(0) for i in range(X): if (X - i) * 2 + i * 4 == Y: print("Yes") exit(0) print("No")
X, Y = map(int, input().split()) if Y % 2 != 0: print("No") exit(0) for i in range(X + 1): if (X - i) * 2 + i * 4 == Y: print("Yes") exit(0) print("No")
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
72
x,y = map(int,input().split()) if y>2*x and (y-2*x)%2==0 and (x>=(y-2*x)//2): print("Yes") else : print("No")
x,y = map(int,input().split()) if y>=2*x and (y-2*x)%2==0 and (x>=(y-2*x)//2): print("Yes") else : print("No")
[["-", 0, 57, 15, 679, 31, 679, 31, 666, 667, 47], ["+", 0, 57, 15, 679, 31, 679, 31, 666, 667, 20]]
5
63
#include <bits/stdc++.h> using namespace std; int main() { int x, y; cin >> x >> y; int a = y - 2 * x; if (a <= 0) { cout << "No" << endl; return 0; } if (a % 2 == 0) { int b = a / 2; if (b <= x) { cout << "Yes" << endl; return 0; } } cout << "No" << endl; return...
#include <bits/stdc++.h> using namespace std; int main() { int x, y; cin >> x >> y; int a = y - 2 * x; if (a < 0) { cout << "No" << endl; return 0; } if (a % 2 == 0) { int b = a / 2; if (b <= x) { cout << "Yes" << endl; return 0; } } cout << "No" << endl; return ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]]
1
98
#include <bits/stdc++.h> typedef long long LL; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; int main() { int X, Y; cin >> X >> Y; if (Y % 2 != 0) { cout << "No" << endl; return 0; } int tsuru, kame; tsuru = 2 * X - Y / 2; kame = -1 * X + Y / 2; // cout << tsuru << e...
#include <bits/stdc++.h> typedef long long LL; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; int main() { int X, Y; cin >> X >> Y; if (Y % 2 != 0) { cout << "No" << endl; return 0; } int tsuru, kame; tsuru = 2 * X - Y / 2; kame = -1 * X + Y / 2; // cout << tsuru << e...
[["-", 51, 16, 12, 23, 0, 16, 31, 16, 17, 47], ["+", 51, 16, 12, 23, 0, 16, 31, 16, 17, 20], ["-", 51, 16, 12, 23, 0, 16, 12, 16, 17, 47], ["+", 51, 16, 12, 23, 0, 16, 12, 16, 17, 20]]
1
126
x,y = map(int,input().split()) b=abs(y-2*x) if b==0: print('Yes') elif b<0: print('No') elif b%2!=0: print('No') elif x >=b/2: print('Yes') else: print('No')
x,y = map(int,input().split()) b=y-2*x if b==0: print('Yes') elif b<0: print('No') elif b%2!=0: print('No') elif x >=b/2: print('Yes') else: print('No')
[["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]]
5
82
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < (n); ++i) #define reps(i, n) for (ll i = 1; i <= (n); ++i) #define _rep(i, n) for (ll i = (n)-1; i >= 0; --i) #define _reps(i, n) for (ll i = n; i > 0; --i) #define all(x) (x).begin(), (x).end() #define _all(x) (x).rbegin(), (x).rend() using namespace std;...
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < (n); ++i) #define reps(i, n) for (ll i = 1; i <= (n); ++i) #define _rep(i, n) for (ll i = (n)-1; i >= 0; --i) #define _reps(i, n) for (ll i = n; i > 0; --i) #define all(x) (x).begin(), (x).end() #define _all(x) (x).rbegin(), (x).rend() using namespace std;...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 0, 57, 15, 339, 51, 16, 12, 23, 0, 24], ["+", 15, 339, 51, 16, 12, 23, 0, 16, 31, 22], ["+", 15, 339, 51, 16, 12, 23, 0, 16, 17, 18], ["+", 15, 339, 51, 16, 12, 23, 0, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 12, 23, 0, 25]]
1
139
import sys x,y = map(int,input().split()) n=x for i in range(1,x+1): a=2*i+4*(x-i) if y==a : print("Yes") sys.exit() print("No")
import sys x,y = map(int,input().split()) n=x for i in range(x+1): a=2*i+4*(x-i) if y==a : print("Yes") sys.exit() print("No")
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 21]]
5
68
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); float x = sc.nextFloat(); float y = sc.nextFloat(); float b = (y - 2 * x) / 2; float a = (x - b); if (b > 0 && b == (int)b) { } else { System.out.print("No"); ...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); float x = sc.nextFloat(); float y = sc.nextFloat(); float b = (y - 2 * x) / 2; float a = (x - b); if (b >= 0 && b == (int)b) { } else { System.out.print("No"); ...
[["-", 0, 57, 15, 15, 0, 16, 31, 16, 17, 47], ["+", 0, 57, 15, 15, 0, 16, 31, 16, 17, 20]]
3
148
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main() { int x, y; cin >> x >> y; int a = 0, B = 0; B = y - 2 * x; if (B > 0 && B % 2 != 0) { cout << "No" << endl; return 0; } a = x - B / 2; if (a >= 0) cout << "Yes" ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main() { int x, y; cin >> x >> y; int a = 0, B = 0; B = y - 2 * x; if (B < 0 || B % 2 != 0) { cout << "No" << endl; return 0; } a = x - B / 2; if (a >= 0) cout << "Yes" ...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 47], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 18], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106]]
1
112
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; typedef long long ll; const int mod = 1E9 + 7; const int inf = 1 << 29; int main() { int x, y; cin >> x >> y; float b = 2 * x - y / 2; float t = -x + y / 2; if (b < 0 | b != int(b)) { cout << "No" << endl; ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; typedef long long ll; const int mod = 1E9 + 7; const int inf = 1 << 29; int main() { float x, y; cin >> x >> y; float b = 2 * x - y / 2; float t = -x + y / 2; if (b < 0 | b != int(b)) { cout << "No" << endl...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
136
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i <= n; i++) using namespace std; using ll = long long; int main() { int x, y; cin >> x >> y; bool conb = false; rep(i, x) { rep(j, x) { int sum = 2 * i + 4 * j; if ((i + j == x) && (sum == y)) conb = true; } } if (con...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i <= n; i++) using namespace std; using ll = long long; int main() { int x, y; cin >> x >> y; bool conb = false; rep(i, x) { rep(j, x) { int sum = 2 * i + 4 * j; if ((i + j == x) && (sum == y)) conb = true; } } if (con...
[["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
113
#include <bits/stdc++.h> using namespace std; #define fio ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); #define tc(t) \ int t; \ cin >> t; ...
#include <bits/stdc++.h> using namespace std; #define fio ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); #define tc(t) \ int t; \ cin >> t; ...
[["+", 51, 16, 31, 16, 31, 16, 31, 16, 31, 22], ["+", 51, 16, 31, 16, 31, 16, 31, 16, 17, 18], ["+", 31, 16, 31, 16, 31, 16, 12, 16, 31, 13], ["+", 31, 16, 31, 16, 31, 16, 12, 16, 17, 48], ["+", 31, 16, 31, 16, 31, 16, 12, 16, 12, 22], ["+", 15, 339, 51, 16, 31, 16, 31, 16, 17, 106]]
1
125
x, y = map(int, input().split()) c=0 for i in range(1, x+1): if 2*i + 4*(x-i) == y: print('Yes') c+=1 break if c==0: print('No')
x, y = map(int, input().split()) c=0 for i in range(0, x+1): if 2*i + 4*(x-i) == y: print('Yes') c+=1 break if c==0: print('No')
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612]]
5
67
#include <bits/stdc++.h> using namespace std; int main() { int x, y; cin >> x >> y; if (y - (2 * x) < 0) { cout << "No"; } else { int ans = (y - (2 * x)); if (ans % 2 == 0 && ans <= x) { cout << "Yes"; } else { cout << "No"; } } // your code goes here return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int x, y; cin >> x >> y; if (y - (2 * x) < 0) { cout << "No"; } else { int ans = (y - (2 * x)); if (ans % 2 == 0 && ans / 2 <= x) { cout << "Yes"; } else { cout << "No"; } } // your code goes here return 0; }
[["+", 15, 339, 51, 16, 12, 16, 31, 16, 17, 85], ["+", 15, 339, 51, 16, 12, 16, 31, 16, 12, 13]]
1
92
#include <iostream> using namespace std; #define f(i, a, b) for (int i = a; i <= b; ++i) int main() { int x, y; cin >> x >> y; if (x * 4 >= y && x * 2 <= y && y % 2 == 0) cout << "YES"; else cout << "NO"; return 0; }
#include <iostream> using namespace std; #define f(i, a, b) for (int i = a; i <= b; ++i) int main() { int x, y; cin >> x >> y; if (x * 4 >= y && x * 2 <= y && y % 2 == 0) cout << "Yes"; else cout << "No"; return 0; }
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
69
x, y = map(int, input().split()) cnt = 0 if x == 1: if y == 2 or y == 4: print('Yes') else: print('No') else: for i in range(x): if i*4 + (x-i)*2 == y: cnt = 1 break else: cnt = 0 if cnt == 0: print('No') else: ...
x, y = map(int, input().split()) cnt = 0 if x == 1: if y == 2 or y == 4: print('Yes') else: print('No') else: for i in range(x+1): if i*4 + (x-i)*2 == y: cnt = 1 break else: cnt = 0 if cnt == 0: print('No') else: ...
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
100
x,y = map(int,input().split()) #if (2*x)<y: z=y-(2*x) #12本足りない z=12 a=z/2 #a=6 亀に変身する鶴の数 if a<=x and a>=0 and z%2==0: print('yes') else: print('No')
x,y = map(int,input().split()) #if (2*x)<y: z=y-(2*x) #12本足りない z=12 a=z/2 #a=6 亀に変身する鶴の数 if a<=x and a>=0 and z%2==0: print('Yes') else: print('No')
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
62
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; const int INF = 1001001001; const int MOD = 1000000007; int main() { int x, y; cin >> x >> y; bool ok = false; for (int i = 0; i <= 100; ++i) { if (i * 2 + (x - i) * 4 == y) ok = true; ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; const int INF = 1001001001; const int MOD = 1000000007; int main() { int x, y; cin >> x >> y; bool ok = false; for (int i = 0; i <= x; ++i) { if (i * 2 + (x - i) * 4 == y) ok = true; ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22]]
1
119
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <limits> #include <map> #include <queue> #include <set> #include <stack> #include <utility> #include <vector> #define rep(i, s, g) for (i = s; i < g; i++) using namespace std; using ll = long long; const int inf = 10...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <limits> #include <map> #include <queue> #include <set> #include <stack> #include <utility> #include <vector> #define rep(i, s, g) for (i = s; i < g; i++) using namespace std; using ll = long long; const int inf = 10...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
147
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int X = sc.nextInt(); int Y = sc.nextInt(); if (Y % 2 == 0 && Y > 2 * X && Y < 4 * X) { System.out.println("Yes"); } else { System.out.println("No"); } }...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int X = sc.nextInt(); int Y = sc.nextInt(); if (Y % 2 == 0 && Y >= 2 * X && Y <= 4 * X) { System.out.println("Yes"); } else { System.out.println("No"); } ...
[["-", 15, 15, 0, 16, 31, 16, 12, 16, 17, 47], ["+", 15, 15, 0, 16, 31, 16, 12, 16, 17, 20], ["-", 0, 57, 15, 15, 0, 16, 12, 16, 17, 18], ["+", 0, 57, 15, 15, 0, 16, 12, 16, 17, 19]]
3
100
#include <bits/stdc++.h> using namespace std; int main() { int x, y, c = 0; cin >> x >> y; for (int i = 0; 2 <= y - (i * 4); i++) { if ((y - (i * 4)) % 2 == 0 && (((y - (i * 4)) / 2) + i) - x == 0) { c += 1; } } if (c == 1) { cout << "Yes" << endl; } else { cout << "No" << endl; } ...
#include <bits/stdc++.h> using namespace std; int main() { int x, y, c = 0; cin >> x >> y; for (int i = 0; 0 <= y - (i * 4); i++) { if ((y - (i * 4)) % 2 == 0 && (((y - (i * 4)) / 2) + i) - x == 0) { c += 1; } } if (c == 1) { cout << "Yes" << endl; } else { cout << "No" << endl; } ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 31, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 31, 13]]
1
123
// Problem : B - Crane and Turtle // Contest : AtCoder - AtCoder Beginner Contest 170 // URL : https://atcoder.jp/contests/abc170/tasks/abc170_b // Memory Limit : 1024 MB // Time Limit : 2000 ms // Powered by CP Editor (https://github.com/cpeditor/cpeditor) #include <bits/stdc++.h> using namespace std; bool legs(int ...
// Problem : B - Crane and Turtle // Contest : AtCoder - AtCoder Beginner Contest 170 // URL : https://atcoder.jp/contests/abc170/tasks/abc170_b // Memory Limit : 1024 MB // Time Limit : 2000 ms // Powered by CP Editor (https://github.com/cpeditor/cpeditor) #include <bits/stdc++.h> using namespace std; bool legs(int ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
116
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; long long ans = 4 * a - b; if ((ans >= 0) && (ans % 2 == 0) && ((ans / 2) <= a)) cout << "YES"; else cout << "NO"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; long long ans = 4 * a - b; if ((ans >= 0) && (ans % 2 == 0) && ((ans / 2) <= a)) cout << "Yes"; else cout << "No"; return 0; }
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
75
#include <bits/stdc++.h> using namespace std; int main() { int X, Y, Z, C; cin >> X; cin >> Y; Z = (4 * X); if (Z < Y || (2 * X) > Y) { cout << "No" << endl; return 0; } else { C = (Z - Y) % 2; } if (C == 0) { cout << "Yes" << endl; } else if (C > 1) { cout << "No" << endl; } ...
#include <bits/stdc++.h> using namespace std; int main() { long int X, Y, Z, C; cin >> X; cin >> Y; Z = (4 * X); if (Z < Y || (2 * X) > Y) { cout << "No" << endl; return 0; } else { C = (Z - Y) % 2; } if (C == 0) { cout << "Yes" << endl; } else if (C == 1) { cout << "No" << endl...
[["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 75, 76, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 75, 76, 0, 57, 15, 339, 51, 16, 17, 60]]
1
110
#include <iostream> using namespace std; int main() { int X, Y; cin >> X >> Y; if ((Y % 2 != 0) || (2 * X > Y && Y > 4 * X)) { cout << "No"; } else { cout << "Yes"; } }
#include <iostream> using namespace std; int main() { int X, Y; cin >> X >> Y; if ((Y % 2 != 0) || (2 * X > Y || Y > 4 * X)) { cout << "No"; } else { cout << "Yes"; } }
[["-", 15, 339, 51, 16, 12, 23, 0, 16, 17, 98], ["+", 15, 339, 51, 16, 12, 23, 0, 16, 17, 106]]
1
64
#include <stdio.h> int main(void) { int x, y; int flag = 0; int X, Y; scanf("%d", &X); scanf("%d", &Y); for (int i = 1; i <= 100; i++) { for (int j = 0; j <= 100; j++) { x = i; y = j; if (x + y == X && 2 * x + 4 * y == Y) { flag = 1; break; } } } if (...
#include <stdio.h> int main(void) { int x, y; int flag = 0; int X, Y; scanf("%d", &X); scanf("%d", &Y); for (int i = 0; i <= 400; i++) { for (int j = 0; j <= 400; j++) { x = i; y = j; if (x + y == X && 2 * x + 4 * y == Y) { flag = 1; break; } } } if (...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13]]
0
140
from sys import stdin,stdout x,y=map(int,stdin.readline().split()) if y&1: print('No') exit(0) t=y//2-1 c=x-t ans='Yes' if c>=0 and t>=0 else 'No' print(ans)
from sys import stdin,stdout x,y=map(int,stdin.readline().split()) if y&1: print('No') exit(0) t=(y//2)-x c=x-t ans='Yes' if c>=0 and t>=0 else 'No' print(ans)
[["+", 0, 1, 0, 662, 12, 657, 31, 23, 0, 24], ["+", 0, 1, 0, 662, 12, 657, 31, 23, 0, 25], ["-", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 22]]
5
72
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define sf scanf #define pf printf #define pb push_back #define MP make_pair #define llu unsigned long long #define U unsigned int #define ff first #define ss second #define SIZE 100005 #define pie 3.14159265358979323 #define minu...
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define sf scanf #define pf printf #define pb push_back #define MP make_pair #define llu unsigned long long #define U unsigned int #define ff first #define ss second #define SIZE 100005 #define pie 3.14159265358979323 #define minu...
[["-", 64, 9, 0, 52, 15, 339, 51, 16, 12, 13], ["+", 64, 9, 0, 52, 15, 339, 51, 16, 12, 13]]
1
316
#include <iostream> using namespace std; int main() { int x, y, i, c, t; bool f = false; cin >> x >> y; for (i = 0; i <= x; i++) { c = i * 2; t = (x - i) * 4; if (c + t == y) { f = true; break; } } if (f) cout << "YES" << endl; else cout << "NO" << endl; }
#include <iostream> using namespace std; int main() { int x, y, i, c, t; bool f = false; cin >> x >> y; for (i = 0; i <= x; i++) { c = i * 2; t = (x - i) * 4; if (c + t == y) { f = true; break; } } if (f) cout << "Yes" << endl; else cout << "No" << endl; }
[["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
102
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define INF 2e9 #define ALL(v) v.begin(), v.end() using namespace std; typedef long long ll; int main() { double a; int X, Y; cin >> X >> Y; a =...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define INF 2e9 #define ALL(v) v.begin(), v.end() using namespace std; typedef long long ll; int main() { double a; int X, Y; cin >> X >> Y; a =...
[["-", 0, 1, 0, 16, 31, 16, 31, 16, 12, 22], ["-", 0, 9, 0, 1, 0, 16, 31, 16, 17, 151]]
1
115
#include <bits/stdc++.h> using namespace std; // typedef typedef long long ll; typedef vector<int> vi; typedef vector<string> vs; // define #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) FOR(i, 0, n) int main() { int x, y; cin >> x >> y; for (int i = 0; i <= x; i++) { for (int j = 0;...
#include <bits/stdc++.h> using namespace std; // typedef typedef long long ll; typedef vector<int> vi; typedef vector<string> vs; // define #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) FOR(i, 0, n) int main() { int x, y; cin >> x >> y; for (int i = 0; i <= x; i++) { for (int j = x ...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 0, 7, 10, 43, 49, 50, 51, 16, 31, 22], ["+", 0, 7, 10, 43, 49, 50, 51, 16, 17, 33], ["+", 0, 7, 10, 43, 49, 50, 51, 16, 12, 22]]
1
132
#include <algorithm> #include <cmath> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int X, Y; cin >> X >> Y; for (int i = 1; i < 100; i++) { for (int j = 1; j < 100; j++) { if (2 * i + 4 * j == Y && i + j == X) { cout << "Yes" << endl; return ...
#include <algorithm> #include <cmath> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int X, Y; cin >> X >> Y; for (int i = 0; i <= 100; i++) { for (int j = 0; j <= 100; j++) { if (2 * i + 4 * j == Y && i + j == X) { cout << "Yes" << endl; retur...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 17, 19]]
1
102
#include <bits/stdc++.h> using namespace std; int main() { int X, Y; cin >> X >> Y; if (Y % 2 == 1) { cout << "No" << endl; return 0; } if (X * 2 > Y) { cout << "No" << endl; } else if (X * 4 < Y) { cout << "No" << endl; } else { for (int i = 0; i < Y / 4; i++) { if ((Y - 4 * ...
#include <bits/stdc++.h> using namespace std; int main() { int X, Y; cin >> X >> Y; if (Y % 2 == 1) { cout << "No" << endl; return 0; } if (X * 2 > Y) { cout << "No" << endl; } else if (X * 4 < Y) { cout << "No" << endl; } else { for (int i = 0; i < 50; i++) { if ((Y - 4 * i) ...
[["-", 0, 9, 0, 7, 15, 16, 12, 16, 31, 22], ["-", 0, 9, 0, 7, 15, 16, 12, 16, 17, 85], ["-", 0, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["+", 75, 76, 0, 9, 0, 7, 15, 16, 12, 13]]
1
139
package main import "fmt" func main() { var x, y int _, _ = fmt.Scan(&x, &y) if turukame(x, y){ fmt.Println("YES") }else { fmt.Println("NO") } } func turukame(x, y int) bool { var s int for i:=0;i<x+1;i++{ s = 2*(x-i) + 4*i if y==s { return true } } return false }
package main import "fmt" func main() { var x, y int _, _ = fmt.Scan(&x, &y) if turukame(x, y){ fmt.Println("Yes") }else { fmt.Println("No") } } func turukame(x, y int) bool { var s int for i:=0;i<x+1;i++{ s = 2*(x-i) + 4*i if y==s { return true } } return false }
[]
7
125
#include <bits/stdc++.h> using namespace std; int main() { string ans = "No"; int x, y; cin >> x >> y; int crane = x, turtle = 0; for (int i = 0; i < x; i++) { crane = x - i; turtle = i; int buf = crane * 2 + turtle * 4; if (buf == y) { ans = "Yes"; break; } } cout << a...
#include <bits/stdc++.h> using namespace std; int main() { string ans = "No"; int x, y; cin >> x >> y; int crane = x, turtle = 0; for (int i = 0; i <= x; i++) { crane = x - i; turtle = i; int buf = crane * 2 + turtle * 4; if (buf == y) { ans = "Yes"; break; } } cout << ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
101
a = list(map(int,input().split())) if (a[0] * 4) >= a[1] and (a[0] * 2) <= a[1] and A[1] % 2 == 0: print("Yes") else: print("No")
a = list(map(int,input().split())) if (a[0] * 4) >= a[1] and (a[0] * 2) <= a[1] and a[1] % 2 == 0: print("Yes") else: print("No")
[["-", 15, 679, 12, 666, 0, 657, 31, 206, 51, 22], ["+", 15, 679, 12, 666, 0, 657, 31, 206, 51, 22]]
5
69
x, y = [int(i) for i in input().split()] a = (4*x-y)/2 b = (y-2*x)/2 ret = (int(a) == a and int(b) == b) and (0<= a and 0 <= y) print('Yes' if ret else 'No')
x, y = [int(i) for i in input().split()] a = (4*x-y)/2 b = (y-2*x)/2 ret = (int(a) == a and int(b) == b) and (0<= a and 0 <= b) print('Yes' if ret else 'No')
[["-", 12, 679, 12, 23, 0, 679, 12, 666, 0, 22], ["+", 12, 679, 12, 23, 0, 679, 12, 666, 0, 22]]
5
81
X,Y=map(int, input().split()) if Y%2==0 and 4*X>=Y>=X: print("Yes") else: print("No")
X,Y=map(int, input().split()) if Y%2==0 and 4*X>=Y>=2*X: print("Yes") else: print("No")
[["+", 0, 57, 15, 679, 12, 666, 0, 657, 31, 612], ["+", 0, 57, 15, 679, 12, 666, 0, 657, 17, 48]]
5
45
#include <iostream> using namespace std; int main() { int n, x; cin >> n >> x; if (x >= 2 * n && x <= 4 * n && x % 2 == 0) { cout << "YES" << endl; } else { cout << "NO" << endl; } return 0; }
#include <iostream> using namespace std; int main() { int n, x; cin >> n >> x; if (x >= 2 * n && x <= 4 * n && x % 2 == 0) { cout << "Yes" << endl; } else { cout << "No" << endl; } return 0; }
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
67
from numpy.linalg import solve X,Y = input().split(" ") left = [[2, 4], [1, 1]] right = [int(Y), int(X)] Ans = solve(left, right) print(Ans) # 数値が整数(小数点以下が0)か、0より大きいか判定 if Ans[0].is_integer() == True and Ans[1].is_integer() == True and Ans[0] >= 0 and Ans[1] >= 0: print("Yes") else: print("No")
from numpy.linalg import solve X,Y = input().split(" ") left = [[2, 4], [1, 1]] right = [int(Y), int(X)] Ans = solve(left, right) #print(Ans) # 数値が整数(小数点以下が0)か、0より大きいか判定 if Ans[0].is_integer() == True and Ans[1].is_integer() == True and Ans[0] >= 0 and Ans[1] >= 0: print("Yes") else: print("No")
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
112
import java.util.*; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int x = scan.nextInt(); int y = scan.nextInt(); int sa = y - (x * 2); int kame = sa / 2; int turu = x - kame; if ((sa % 2 == 2) && kame >= 0 && turu >= 0) { Syst...
import java.util.*; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int x = scan.nextInt(); int y = scan.nextInt(); int sa = y - (x * 2); int kame = sa / 2; int turu = x - kame; if ((sa % 2 == 0) && kame >= 0 && turu >= 0) { Syst...
[["-", 0, 16, 31, 16, 31, 23, 0, 16, 12, 499], ["+", 0, 16, 31, 16, 31, 23, 0, 16, 12, 499]]
3
123
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int X, Y; cin >> X >> Y; if (Y % 2 == 0 && Y >= X * 2 && Y <= X * 4) { cout << "YES"; } else { cout << "NO"; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int X, Y; cin >> X >> Y; if (Y % 2 == 0 && Y >= X * 2 && Y <= X * 4) { cout << "Yes"; } else { cout << "No"; } return 0; }
[["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["-", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
77
n, legs= map(int, input().split(" ")) x = (legs - 2*n)/2 y = (4*n - legs)/2 if x%1==0 and y%1==0 and (x>0 or y>0): print('Yes') else: print('No')
n, legs= map(int, input().split(" ")) x = (legs - 2*n)/2 y = (4*n - legs)/2 if x%1==0 and y%1==0 and (x>=0 and y>=0): print('Yes') else: print('No')
[["-", 15, 679, 12, 23, 0, 679, 31, 666, 667, 47], ["+", 15, 679, 12, 23, 0, 679, 31, 666, 667, 20], ["-", 0, 57, 15, 679, 12, 23, 0, 679, 17, 354], ["+", 0, 57, 15, 679, 12, 23, 0, 679, 17, 355], ["-", 15, 679, 12, 23, 0, 679, 12, 666, 667, 47], ["+", 15, 679, 12, 23, 0, 679, 12, 666, 667, 20]]
5
78
#include <algorithm> #include <bits/stdc++.h> using namespace std; #define ll long long // int l[n+1]; int main() { int x, y; cin >> x >> y; int a; if ((4 * x - y) / 2 >= 0 && (4 * x - y) % 2 == 0 && y % 2 == 0) { cout << "Yes"; } else { cout << "No"; } }
#include <algorithm> #include <bits/stdc++.h> using namespace std; #define ll long long // int l[n+1]; int main() { int x, y; cin >> x >> y; int a; if ((4 * x - y) / 2 >= 0 && (4 * x - y) % 2 == 0 && (y - 2 * x) >= 0) { cout << "Yes"; } else { cout << "No"; } }
[["+", 15, 339, 51, 16, 12, 16, 31, 23, 0, 24], ["-", 15, 339, 51, 16, 12, 16, 31, 16, 17, 109], ["+", 51, 16, 12, 16, 31, 23, 0, 16, 17, 33], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 22], ["+", 15, 339, 51, 16, 12, 16, 31, 23,...
1
81
int2=tuple(map(int,input().split())) t=0 for a in range(0,int2[0]): for b in range(0,int2[0]): if a+b==int2[0] and 2*a+4*b==int2[1]: t+=1 break if t==0: print("No") else: print("Yes")
int2=tuple(map(int,input().split())) t=0 for a in range(0,int2[0]+1): for b in range(0,int2[0]+1): if a+b==int2[0] and 2*a+4*b==int2[1]: t+=1 break if t==0: print("No") else: print("Yes")
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
92
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int x, y; cin >> x >> y; if ((y - 2 * x) < 0 || (4 * x - y) < 0) { cout << "NO"; } else if ((y - 2 * x) % 2 == 0 && (4 * x - y) % 2 == 0) { cout << "YES"; } else { cout << "NO"; } return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int x, y; cin >> x >> y; if ((y - 2 * x) < 0 || (4 * x - y) < 0) { cout << "No"; } else if ((y - 2 * x) % 2 == 0 && (4 * x - y) % 2 == 0) { cout << "Yes"; } else { cout << "No"; } return 0; }
[["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["-", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
105
#include <bits/stdc++.h> using namespace std; int main() { int x, y; cin >> x >> y; if (y % 2 == 1 && (4 * x < y || 2 * x > y)) cout << "No" << endl; else cout << "Yes" << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int x, y; cin >> x >> y; if (y % 2 == 1 || 4 * x < y || 2 * x > y) cout << "No" << endl; else cout << "Yes" << endl; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["-", 0, 57, 15, 339, 51, 16, 12, 23, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 106], ["-", 0, 57, 15, 339, 51, 16, 12, 23, 0, 25]]
1
62
X,Y = map(int, input().split()) if Y % 2 == 1: print("No") result_list = [] for a in range(X+1): result_list.append(2 * a + 4 * (X - a) == Y) if any(result_list): print('Yes') else: print('No')
X,Y = map(int, input().split()) if Y % 2 == 1: print("No") else: result_list = [] for a in range(X+1): result_list.append(2 * a + 4 * (X - a) == Y) if any(result_list): print('Yes') else: print('No')
[["+", 36, 36, 0, 656, 0, 57, 75, 76, 0, 95], ["+", 36, 36, 0, 656, 0, 57, 75, 76, 0, 102]]
5
81
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; if (n == 1 && m == 4) { cout << "Yes"; return 0; } if (n * 4 <= m) { cout << "No"; return 0; } int sum = n * 4 - m; if (sum % 2 == 0) { int c1 = sum / 2; int t1 = n - c1; if (t1 * 4 + c1 * ...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; if (n == 1 && m == 4) { cout << "Yes"; return 0; } if (n * 4 < m) { cout << "No"; return 0; } int sum = n * 4 - m; if (sum % 2 == 0) { int c1 = sum / 2; int t1 = n - c1; if (t1 * 4 + c1 * 2...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]]
1
149
x,y = map(int,input().split()) for i in range(1,x+1): if 2*i + 4*(x-i) == y: print("Yes") exit() else: print("No")
x,y = map(int,input().split()) for i in range(0,x+1): if 2*i + 4*(x-i) == y: print("Yes") exit() else: print("No")
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612]]
5
60
#include <bits/stdc++.h> using namespace std; #define CLR(a) memset(a, 0, sizeof(a)) #define SET(a) memset(a, -1, sizeof(a)) #define nl "\n"; #define FIO \ ios_base::sync_with_stdio(false); \ cout.setf(io...
#include <bits/stdc++.h> using namespace std; #define CLR(a) memset(a, 0, sizeof(a)) #define SET(a) memset(a, -1, sizeof(a)) #define nl "\n"; #define FIO \ ios_base::sync_with_stdio(false); \ cout.setf(io...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
502
#include <bits/stdc++.h> using namespace std; #define ll int #define nl endl #define pi 3.14159265358979323846 #define ff first #define ss second #define pb push_back #define watch(xxx) cerr << (#xxx) << " is " << xxx << nl; const int N = 200100; vector<int> v; //~ int m[1000006+100]; int main() { ll t = 1; //...
#include <bits/stdc++.h> using namespace std; #define ll int #define nl endl #define pi 3.14159265358979323846 #define ff first #define ss second #define pb push_back #define watch(xxx) cerr << (#xxx) << " is " << xxx << nl; const int N = 200100; vector<int> v; //~ int m[1000006+100]; int main() { ll t = 1; //...
[["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["-", 8, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 8, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
155
<?php fscanf(STDIN, "%d %d", $a, $b); $result = "No"; for($i=2*$a; $i <= (4*$a)-2; $i=$i+2){ if($i === $b){ $result = "Yes"; } } echo $result; ?>
<?php fscanf(STDIN, "%d %d", $a, $b); $result = "No"; for($i=2*$a; $i <= 4*$a; $i=$i+2){ if($i === $b){ $result = "Yes"; } } echo $result; ?>
[["-", 0, 7, 0, 16, 12, 16, 31, 23, 0, 24], ["-", 0, 7, 0, 16, 12, 16, 31, 23, 0, 25], ["-", 0, 493, 0, 7, 0, 16, 12, 16, 17, 33], ["-", 0, 493, 0, 7, 0, 16, 12, 16, 12, 612]]
6
77
X, Y = map(int, input().split()) test = ((4 * X) - Y) / 2 ans = ((4 * X) - Y) % 2 if ans == 0 and test >= 0: print('Yes') else: print('No')
X, Y = map(int, input().split()) test = ((4 * X) - Y) / 2 ans = ((4 * X) - Y) % 2 if ans == 0 and test >= 0 and test <= X: print('Yes') else: print('No')
[["+", 36, 36, 0, 656, 0, 57, 15, 679, 17, 355], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 0, 22], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 667, 19]]
5
65
#define lp(i, n) for (int i = 0; i < n; i++) typedef long long ll; using namespace std; #include <bits/stdc++.h> int main() { int x, y; bool f = false; cin >> x >> y; for (int i = 1; i <= x; ++i) { for (int j = 0; i + j <= x; ++j) { if (2 * i + 4 * j == y) if (i + j == x) { f = true...
#define lp(i, n) for (int i = 0; i < n; i++) typedef long long ll; using namespace std; #include <bits/stdc++.h> int main() { int x, y; bool f = false; cin >> x >> y; for (int i = 0; i <= x; ++i) { for (int j = 0; i + j <= x; ++j) { if (2 * i + 4 * j == y) if (i + j == x) { f = true...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
127
x, y = input().split() x = int(x) y = int(y) def check(x, y): # 動物の可能性を考える for i in range(0, x): # 2本足,4本足の動物の数 leg2_animal = i leg4_animal = x - leg2_animal # 全体の足の数を数えてみる sum_legs = leg2_animal * 2 + leg4_animal * 4 if sum_legs == y: print...
x, y = input().split() x = int(x) y = int(y) def check(x, y): # 動物の可能性を考える for i in range(0, x+1): # 2本足,4本足の動物の数 leg2_animal = i leg4_animal = x - leg2_animal # 全体の足の数を数えてみる sum_legs = leg2_animal * 2 + leg4_animal * 4 if sum_legs == y: pri...
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
85
s = input() lst = s.split() ex1 = int(lst[0]) ex2 = int(lst[1]) ret = "no" for i in range(ex1+1): if 4 * (ex1 - i) + 2 * i == ex2: ret= "yes" print(ret)
s = input() lst = s.split() ex1 = int(lst[0]) ex2 = int(lst[1]) ret = "No" for i in range(ex1+1): if 4 * (ex1 - i) + 2 * i == ex2: ret= "Yes" print(ret)
[["-", 0, 656, 0, 1, 0, 662, 12, 557, 0, 6], ["+", 0, 656, 0, 1, 0, 662, 12, 557, 0, 6], ["-", 64, 196, 0, 1, 0, 662, 12, 557, 0, 6], ["+", 64, 196, 0, 1, 0, 662, 12, 557, 0, 6]]
5
69
#include <bits/stdc++.h> using namespace std; typedef long long ll; template <typename T> ostream &operator<<(ostream &os, vector<T> &v) { string sep = " "; if (v.size()) os << v[0]; for (int i = 1; i < v.size(); i++) os << sep << v[i]; return os; } template <typename T> istream &operator>>(istream &i...
#include <bits/stdc++.h> using namespace std; typedef long long ll; template <typename T> ostream &operator<<(ostream &os, vector<T> &v) { string sep = " "; if (v.size()) os << v[0]; for (int i = 1; i < v.size(); i++) os << sep << v[i]; return os; } template <typename T> istream &operator>>(istream &i...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
312
# coding: utf-8 # Your code here! x, y = list(map(int, input().split())) if(y > x*4): print("no") elif(y/2 < x): print("No") else: if(y%2 == 1): print("No") else: print("Yes")
# coding: utf-8 # Your code here! x, y = list(map(int, input().split())) if(y > x*4): print("No") elif(y/2 < x): print("No") else: if(y%2 == 1): print("No") else: print("Yes")
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
76
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using Vec = vector<int>; int main() { int a, b; cin >> a >> b; bool x = true; for (int i = 1; i <= a; i++) { if (i * 2 + 4 * (a - i) == b) { cout << "Yes" << endl; x = false; break; } } i...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using Vec = vector<int>; int main() { int a, b; cin >> a >> b; bool x = true; for (int i = 0; i <= a; i++) { if (i * 2 + 4 * (a - i) == b) { cout << "Yes" << endl; x = false; break; } } i...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
112
x,y = map(int,input().split()) if y % 2 != 0: print("NO") elif y % 2 == 0: s = "A" for i in range(0,101): for j in range(0,101): if 2*i + 4*j == y and i + j == x: print("YES") exit() else: s = "NO" print(s)
x,y = map(int,input().split()) if y % 2 != 0: print("No") elif y % 2 == 0: s = "A" for i in range(0,101): for j in range(0,101): if 2*i + 4*j == y and i + j == x: print("Yes") exit() else: s = "No" print(s)
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["-", 8, 196, 0, 1, 0, 662, 12, 557, 0, 6], ["+", 8, 196, 0, 1, 0, 662, 12, 557, 0, 6]]
5
98
def main(): x, y = list(map(int, input().split())) for i in range(0, x+1): if i * 2 + x-i * 4 == y or x-i * 4 + i * 2 == y: print('Yes') exit() print('No') if __name__ == '__main__': main()
def main(): x, y = list(map(int, input().split())) for i in range(0, x+1): if i * 2 + (x-i) * 4 == y or (x-i) * 4 + i * 2 == y: print('Yes') exit() print('No') if __name__ == '__main__': main()
[["+", 31, 666, 0, 657, 12, 657, 31, 23, 0, 24], ["+", 31, 666, 0, 657, 12, 657, 31, 23, 0, 25], ["+", 12, 666, 0, 657, 31, 657, 31, 23, 0, 24], ["+", 12, 666, 0, 657, 31, 657, 31, 23, 0, 25]]
5
86
X, Y = map(int, input().split()) t = Y - 2*X u = 4*X - Y if (t >= 2) & (t % 2 == 0) & (u >= 2) & (u % 2 == 0): print("Yes") else: print("No")
X, Y = map(int, input().split()) t = Y - 2*X u = 4*X - Y if (t >= 0) & (t % 2 == 0) & (u >= 0) & (u % 2 == 0): print("Yes") else: print("No")
[["-", 31, 657, 31, 657, 31, 23, 0, 666, 0, 612], ["+", 31, 657, 31, 657, 31, 23, 0, 666, 0, 612], ["-", 15, 657, 31, 657, 12, 23, 0, 666, 0, 612], ["+", 15, 657, 31, 657, 12, 23, 0, 666, 0, 612]]
5
73
x,y=map(int,input().split()) for i in range(x): if (x-i)*2+i*4==y: print("Yes") exit() print("No")
x,y=map(int,input().split()) for i in range(x+1): if (x-i)*2+i*4==y: print("Yes") exit() print("No")
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
54
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { int x, y; cin >> x >> y; int kame, sum_legs; string ans = "No"; if (x == 1) { if (y == 2 || y == 4) { ans = "Yes"; } } else { for (int...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { int x, y; cin >> x >> y; int kame, sum_legs; string ans = "No"; if (x == 1) { if (y == 2 || y == 4) { ans = "Yes"; } } else { for (int...
[["-", 0, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 0, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
149
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll mx = 10000007; const ll mod = 1e9 + 7; #define gcd(a, b) __gcd((a), (b)) #define lcm(a, b) ((a) / __gcd((a), (b)) * (b)) int main() { ll n, t; cin >> n >> t; for (ll i = 0; i <= n; i++) { for (ll j = 0; j <= n; j++) { if ((((...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll mx = 10000007; const ll mod = 1e9 + 7; #define gcd(a, b) __gcd((a), (b)) #define lcm(a, b) ((a) / __gcd((a), (b)) * (b)) int main() { ll n, t; cin >> n >> t; for (ll i = 0; i <= n; i++) { for (ll j = 0; j <= n; j++) { if ((((...
[["+", 0, 16, 31, 23, 0, 16, 31, 23, 0, 24], ["+", 51, 16, 31, 23, 0, 16, 12, 23, 0, 25]]
1
158
import sys input = lambda: sys.stdin.readline().rstrip() def main(): x, y = map(int, input().split()) for i in range(x + 1): num = ((2 * i) + (4 * (x - i))) if y == num: print('yes') exit() print('No') if __name__ == '__main__': main()
import sys input = lambda: sys.stdin.readline().rstrip() def main(): x, y = map(int, input().split()) for i in range(x + 1): num = ((2 * i) + (4 * (x - i))) if y == num: print('Yes') exit() print('No') if __name__ == '__main__': main()
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
97
a, b = list(map(int,input().split())) z= 0 if b% 2!=0: print("No") else: while a>=0: c = a*2+z*4 if c ==b: print("Yes") quit() a-=1 z+=1 print("No")
a, b = list(map(int,input().split())) z= 0 if b% 2!=0: print("No") quit() else: while a>=0: c = a*2+z*4 if c ==b: print("Yes") quit() a-=1 z+=1 print("No")
[["+", 0, 57, 64, 196, 0, 1, 0, 652, 63, 22], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
77
#include <iostream> #include <string> int main() { int x, y; std::cin >> x >> y; std::string YorN = "No"; for (int i = 1; i <= x; i++) { if (2 * i + 4 * (x - i) == y) { YorN = "Yes"; } } std::cout << YorN << std::endl; }
#include <iostream> #include <string> int main() { int x, y; std::cin >> x >> y; std::string YorN = "No"; for (int i = 0; i <= x; i++) { if (2 * i + 4 * (x - i) == y) { YorN = "Yes"; } } std::cout << YorN << std::endl; }
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
82
num = input().split() x = int(num[0]) y = int(num[1]) cr = ((4 * x) - y) / 2 tur = (y - (2 * x)) / 2 if cr - int(cr) == 0 and tur - int(tur) == 0 and tur > 0 and cr > 0: if cr + tur == x and (2 * cr) + (4 * tur) == y: print("Yes") else: print("No")
num = input().split() x = int(num[0]) y = int(num[1]) cr = ((4 * x) - y) / 2 tur = (y - (2 * x)) / 2 if cr - int(cr) == 0 and tur - int(tur) == 0 and tur >= 0 and cr >= 0: if cr + tur == x and (2 * cr) + (4 * tur) == y: print("Yes") else: print("No")
[["-", 0, 57, 15, 679, 31, 679, 12, 666, 667, 47], ["+", 0, 57, 15, 679, 31, 679, 12, 666, 667, 20], ["-", 0, 656, 0, 57, 15, 679, 12, 666, 667, 47], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 667, 20]]
5
115
import java.util.Scanner; class Main { public static void main(String[] args) { var scaner = new Scanner(System.in); var x = scaner.nextInt(); var y = scaner.nextInt(); var ans = "No"; for (int i = 1; i <= x; i++) { if ((i * 2) + (x - i) * 4 == y) { ans = "Yes"; break; ...
import java.util.Scanner; class Main { public static void main(String[] args) { var scaner = new Scanner(System.in); var x = scaner.nextInt(); var y = scaner.nextInt(); var ans = "No"; for (int i = 0; i <= x; i++) { if ((i * 2) + (x - i) * 4 == y) { ans = "Yes"; break; ...
[["-", 8, 196, 0, 7, 502, 503, 49, 200, 51, 499], ["+", 8, 196, 0, 7, 502, 503, 49, 200, 51, 499]]
3
118
#include <bits/stdc++.h> using namespace std; int main() { int x, y; cin >> x >> y; int leg1 = x * 4; int leg2 = x * 2; if (y == leg1 || y == leg2) { cout << "Yes\n"; } else { for (int i = 1; i <= x; i++) { if ((i * 2 + (x - i) * 4) == y) { cout << "Yes\n"; return 0; } ...
#include <bits/stdc++.h> using namespace std; int main() { int x, y; cin >> x >> y; int leg1 = x * 4; int leg2 = x * 2; if (y == leg1 || y == leg2) { cout << "Yes\n"; } else { for (int i = 1; i <= x; i++) { if ((i * 2 + (x - i) * 4) == y) { cout << "Yes\n"; return 0; } ...
[["-", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
112
#include <stdio.h> int main() { int x, y; scanf("%d%d", &x, &y); for (int i = 0; i < x; i++) { if (2 * i + 4 * (x - i) == y) { printf("Yes"); return 0; } } printf("No"); return 0; }
#include <stdio.h> int main() { int x, y; scanf("%d%d", &x, &y); for (int i = 0; i <= x; i++) { if (2 * i + 4 * (x - i) == y) { printf("Yes"); return 0; } } printf("No"); return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
80
(x,y)= input().split() x = int(x) y = int(y) for i in range (x): if 4*i + 2*(x-i) == y: print("Yes") break else: print("No")
(x,y)= input().split() x = int(x) y = int(y) for i in range (x+1): if 4*i + 2*(x-i) == y: print("Yes") break else: print("No")
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
63
#include <iostream> using namespace std; int main() { int a = 1, b, c = 0, x, y; cin >> x >> y; for (int i = 1; i <= x; i++) { b = 2 * a + 4 * (x - a); if (b == y) { c++; cout << "Yes"; break; } else { a++; continue; } } if (c == 0) cout << "No"; return 0;...
#include <iostream> using namespace std; int main() { int a = 0, b, c = 0, x, y; cin >> x >> y; for (int i = 0; i <= x; i++) { b = 2 * a + 4 * (x - a); if (b == y) { c++; cout << "Yes"; break; } else { a++; continue; } } if (c == 0) cout << "No"; return 0;...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
105
import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int X = sc.nextInt(); int Y = sc.nextInt(); sc.close(); int bb = (Y - 2 * X); // System.out.println(bb); if (bb % 2 != 0 || bb < 0) { System....
import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int X = sc.nextInt(); int Y = sc.nextInt(); sc.close(); int bb = (Y - 2 * X); if (bb % 2 != 0 || bb < 0) { System.out.println("No"); return...
[["+", 8, 196, 0, 57, 64, 196, 0, 37, 0, 38], ["+", 8, 196, 0, 57, 64, 196, 0, 37, 0, 35]]
3
149
X, Y = map(int, input().split()) for T in range(100): for K in range(100): if (T+K) == X and (2*T) + (4*K) == Y: print("YES") exit() print("NO")
X, Y = map(int, input().split()) for T in range(100): for K in range(100): if (T+K) == X and (2*T) + (4*K) == Y: print("Yes") exit() print("No")
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
70
x,y = map(int,input().split()) import sys if x == 1 and y == 2: print('Yes') elif x == 1 and y == 4: print('Yes') else: for i in range(1,x+1): tmp = i*2+(4*(x-i)) if tmp == y: print('Yes') sys.exit() print('No')
x,y = map(int,input().split()) import sys if x == 1 and y == 2: print('Yes') elif x == 1 and y == 4: print('Yes') else: for i in range(x+1): tmp = i*2+(4*(x-i)) if tmp == y: print('Yes') sys.exit() print('No')
[["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 21]]
5
99
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int legs = sc.nextInt(); if (legs <= (n * 4) && legs >= (n * 2) && (n % 2) == 0) System.out.println("Yes"); else System.out.println("No"); ...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int legs = sc.nextInt(); if (legs <= (n * 4) && legs >= (n * 2) && (legs % 2) == 0) System.out.println("Yes"); else System.out.println("No")...
[["-", 0, 16, 12, 16, 31, 23, 0, 16, 31, 22], ["+", 0, 16, 12, 16, 31, 23, 0, 16, 31, 22]]
3
102
#include <bits/stdc++.h> using namespace std; int main() { int hiki, asi; cin >> hiki >> asi; int sa = asi - hiki * 2; if (hiki * 2 <= asi && hiki * 4 >= asi && sa % 2 == 0) { cout << "yes" << endl; } else { cout << "no" << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int hiki, asi; cin >> hiki >> asi; int sa = asi - hiki * 2; if (hiki * 2 <= asi && hiki * 4 >= asi && sa % 2 == 0) { cout << "Yes" << endl; } else { cout << "No" << endl; } }
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
73
/* @uthor: Varun Mishra "varun21999" -> Codechef, Codeforce, Hackerrank, Hackerearth; */ //#include<boost/multiprecision/cpp_int.hpp> // using boost::multiprecision::cpp_int; #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using...
/* @uthor: Varun Mishra "varun21999" -> Codechef, Codeforce, Hackerrank, Hackerearth; */ //#include<boost/multiprecision/cpp_int.hpp> // using boost::multiprecision::cpp_int; #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
284
function Main(arg) { var arg = arg.trim().split(' '); let x = Number(arg[0]); let y = Number(arg[1]); if (y % 2 != 0 || x > y) { console.log("No"); return; } else if (x * 2 <= y && x * 4 > y) { let a = (4 * x - y) / 2; let b = x - a; if (a + b == x) { console.log("Yes"); retur...
function Main(arg) { var arg = arg.trim().split(' '); let x = Number(arg[0]); let y = Number(arg[1]); if (y % 2 != 0 || x > y) { console.log("No"); return; } else if (x * 2 <= y && x * 4 >= y) { let a = (4 * x - y) / 2; let b = x - a; if (a + b == x) { console.log("Yes"); retu...
[["-", 0, 57, 15, 23, 0, 16, 12, 16, 17, 47], ["+", 0, 57, 15, 23, 0, 16, 12, 16, 17, 20]]
2
160
#include <algorithm> #include <iomanip> // input output manipulation #include <iostream> // input output stream, cin cout( console in console out) #include <stdio.h> // standard input output #include <string> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (int)n; i++) #define ll long lo...
#include <algorithm> #include <iomanip> // input output manipulation #include <iostream> // input output stream, cin cout( console in console out) #include <stdio.h> // standard input output #include <string> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (int)n; i++) #define ll long lo...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
123
y, x = map(int, input().split()) tsuru = (x-2*y)/2 kame = (4*y-x)/2 if tsuru < 0 or kame < 0: print('no') elif (x-2*y)%2 == 0 and (4*y-x)%2 == 0: print('Yes') else: print('No')
y, x = map(int, input().split()) tsuru = (x-2*y)/2 kame = (4*y-x)/2 if tsuru < 0 or kame < 0: print('No') elif (x-2*y)%2 == 0 and (4*y-x)%2 == 0: print('Yes') else: print('No')
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
92
N,M=map(int,input().split()) for i in range(N): j=N-i if 2*i + 4*j == M: print("Yes") exit() print("No")
N,M=map(int,input().split()) for i in range(N+1): j=N-i if 2*i + 4*j == M: print("Yes") exit() print("No")
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
55
#include <bits/stdc++.h> using namespace std; int main() { int x, y; cin >> x >> y; if (y > x * 4 || y % 2 != 0) cout << "No\n"; else cout << "Yes\n"; }
#include <bits/stdc++.h> using namespace std; int main() { int x, y; cin >> x >> y; if (y > x * 4 || y % 2 != 0 || x > y / 2) cout << "No\n"; else cout << "Yes\n"; /* int n; cin>>n; int a[n]; for(int i=0;i<n;i++) { cin>>a[i]; }*/ }
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 47], ["+", 15, 339, 51, 16, 12, 16, 12, 16, 31, 22], ["+", 15, 339, 51, 16, 12, 16, 12, 16, 17, 85], ["+", 15, 339, 51, 16, 12, 16, 12, 16, 12, 13]]
1
52