prompt string | response string |
|---|---|
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | # Contest: Educational Codeforces Round 76 (Rated for Div. 2) (https://codeforces.com/contest/1257)
# Problem: B: Magic Stick (https://codeforces.com/contest/1257/problem/B)
def rint():
return int(input())
def rints():
return list(map(int, input().split()))
t = rint()
for _ in range(t):
x, y = rints()
... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | def solve(a, b):
if a == 1:
if b == 1:
return 'YES'
else:
return 'NO'
if a == 2:
if b < 4:
return 'YES'
else:
return 'NO'
if a == 3:
if b < 4:
return 'YES'
else:
return 'NO'
return 'Y... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) {
InputStream inputStream = System.in;
Out... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | import sys
input = sys.stdin.readline
def main():
N = int(input())
for _ in range(N):
x, y = [int(x) for x in input().split()]
if x == y:
print("YES")
elif x == 2 and y == 3:
print("YES")
elif x <= 3 and y > x:
print("NO")
else:
... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | for _ in range(int(input())):
x, y = map(int, input().split())
if x >= y:
print("YES")
else:
if x == 1:
print("NO")
elif x == 2 and y > 3:
print("NO")
elif x == 3 and y > 3:
print("NO")
else:
print("YES") |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | # -*- coding: utf-8 -*-
"""
Created on Fri Nov 15 09:32:42 2019
@author: Administrator
"""
def printout(x):
if x: print("Yes")
else: print("No")
t = int(input())
for i in range(0,t):
x,y = list(map(int, input().split()))
if (x == 1): printout(y==1)
else:
if ((x==2) | (x==3)): printout(y<=3... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | for _ in range(int(input())):
a, b = map(int, input().split())
print('NO' if (a in [1, 3] and b > a) or (a == 2 and b > 3) else 'YES')
|
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n, k;
cin >> n >> k;
if (n == k)
cout << "yes\n";
else if (n == 1 && k > 1)
cout << "no\n";
else if ((n == 3 || n == 2) && k <= 3)
cout << "yes\n";
else if ((n == 3 || n == 2) &&... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
int tc = sc.nextInt();
while(tc-- > 0){
int x = sc.nextInt(); int y = sc.nextInt();
if(x == 1 && y == 1) pw.println("YES");
else if((x == 2 || x... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | import sys, math
def input():
return sys.stdin.readline()[:-1]
def main():
q = int(input())
for _ in range(q):
x, y = map(int,input().split())
if x == 1:
if y == 1:
print("YES")
else:
print("NO")
elif x <= 3:
if y ... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | for i in range(int(input())):
x,y = [int(z) for z in input().split()]
# x is current and y is desired
if x == y:
print("yes")
elif x<4 and y >=4:
print("no")
elif x < 4 and y <4:
if x == 1:
print("no")
else:
print("yes")
else:
prin... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | #include <bits/stdc++.h>
using namespace std;
const long long N = 2 * 1e5 + 4;
long long add(long long a, long long b, long long m) {
if (a < 0) a += m;
if (b < 0) b += m;
long long res = ((a % m) + (b % m)) % m;
res %= m;
return res;
}
long long mul(long long a, long long b, long long m) {
if (a < 0) a += ... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | #------------------------template--------------------------#
import os
import sys
from math import *
from collections import *
from bisect import *
from io import BytesIO, IOBase
def vsInput():
sys.stdin = open('input.txt', 'r')
sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192
class FastIO(IOBase):
newli... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | for _ in range(int(input())):
a,b = map(int,input().split())
if a>=b:
print('YES')
else:
if (a//2)*3>a:
if a==2 and b>3:
print('NO')
else:
print('YES')
else:
print('NO')
|
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | for _ in range(int(input())):
x,y = map(int,input().split())
if(x<4):
if(x==1 and y==1):
print("YES")
elif(x==2 and (y==3 or y==1 or y==2)):
print("YES")
elif(x == 3 and (y == 1 or y==2 or y == 3)):
print("YES")
else:
print("NO")
... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | for x in range(int(input())):
x,y=list(map(int,input().split()))
if x==1 and y>1:
print('No')
elif x<=3 and y>3:
print('No')
else:
print('Yes')
|
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | def highestPowerof2(n):
res = 0;
for i in range(n, 0, -1):
if ((i & (i - 1)) == 0):
res = i
break
return res
for _ in range(int(input())):
x,y=[int(i) for i in input().split()]
pos=0
if(x>=y):
pos=1
res=x
while(1):
prev=res
if(r... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | import sys
def readline_single(dtype):
"""Read a single element from standard input, e.g:
N = readline_single(int)
"""
return dtype(sys.stdin.readline().rstrip())
def readline_multiple(dtype):
"""Read multiple elements from standard input, e.g:
N, M = readline_multipl... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | t = int(input())
for i in range(t):
x,y = map(int, input().split())
if x > 3:
print("YES")
elif x == 1:
print("YES" if y == 1 else "NO")
else:
print("YES" if y <= 3 else "NO")
|
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | for i in range(int(input())):
x,y=list(map(int,input().split()))
if x>=4:
print("YES")
else:
if y>3:
print("NO")
else:
if x==2 or x==3:
print("YES")
else:
if y==1:
print("YES")
els... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | from sys import stdin
out = []
for _ in range(int(stdin.readline())):
x, y = map(int, stdin.readline().split())
if x >= y or x >= 4 or x == 2 and y == 3:
out.append('yes')
else:
out.append('no')
print('\n'.join(out))
|
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | #include <bits/stdc++.h>
int main() {
int t;
scanf("%d", &t);
while (t--) {
int x, y;
scanf("%d%d", &x, &y);
if (x >= 4)
printf("YES\n");
else {
if (x == 2) {
if (y < 4)
printf("YES\n");
else
printf("NO\n");
} else {
if (x >= y)
... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | ### B. Magic sticks
for _ in range(int(input())):
x,y=map(int, input().split())
if 4>x<y and (x,y)!=(2,3):
print('NO')
else:
print('YES') |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | for _ in range(int(input())):x,y = [int(i) for i in input().split(' ')];print('NO' if (x==1 and y!=1) or(1<x<4 and y>3) else 'YES'); |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... |
t = int(input())
yeh = 1
for _ in range(t):
x,y = map(int,input().split())
if x>=y:
print("YES")
continue
if x==1:
print("NO")
continue
elif (x==2 and y==3):
print("YES")
elif x==2 or x==3:
print("NO")
else:
print("YES") |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int t;
int x, y;
cin >> t;
for (int i = 0; i < t; i++) {
cin >> x >> y;
if (x == 1) {
if (y == 1) {
cout << "YES" << endl;
} else {
cout << "NO" << endl;
}
} else if (x <= 3) {
if (y <= 3) {
co... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | def magic(x, y):
if(x >= y):
return("YES")
elif(x == 1) or (x == 3):
return("NO")
elif(x == 2) and (y > 3):
return("NO")
return("YES")
for _ in range(int(input())):
x, y = list(map(int, input().split()))
print(magic(x,y)) |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | T=int(input())
for i in range(T):
l=list(map(int,input().split(" ")))
curr,dest=l[0],l[1]
if (curr==1 and dest!=1) or (curr in [1,2,3] and dest not in [1,2,3]):
print("NO")
else:
print("YES")
|
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | # ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
# ░░░░░░░▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄░░░░░░
# ░░░░░░█░░▄▀▀▀▀▀▀▀▀▀▀▀▀▄░░█░░░░░
# ░░░░░░█░█░░▀░░░░░░░░▀░░█░█░░░░░
# ░░░░░░█░█░░░▀░░░░░░▀░░░█░█░░░░░
# ░░░░░░█░█░░░░▀░░░░▀░░░░█░█░░░░░
# ░░░░░░█░█▄░░░░▀░░▀░░░░▄█░█░░░░░
# ░░░░░░█░█░░░░░░██░░░░░░█░█░░░░░
# ░░░░░░█░▀░░░░░░░░░░░░░░▀░█░░░░░
# ░░░░░░█░░░░... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | i = int(input(""))
a = [0]*i
for j in range (i):
x,y = [int(x) for x in input("").split()]
if (x > 3):
a[j] = "yes"
elif (x>=y):
a[j]= "yes"
elif (x==2 and y==3):
a[j] = "yes"
else:
a[j] = "no"
for k in range (i):
print (a[k]) |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | #!/usr/bin/env python3
t = int(input())
for _ in range(t):
x, y = map(int, input().split())
if x == 1:
ans = (y == 1)
elif x == 2 or x == 3:
ans = (y <= 3)
else:
ans = True
print(ans and 'YES' or 'NO')
|
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | t = int(raw_input())
for i in xrange(t):
x, y = map(int, raw_input().split())
if(y > x and (x == 1 or x == 3 or (x == 2 and y > 3))):
print("NO")
else:
print("YES") |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... |
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;
import java.util.TreeMap;
import java.util.Tr... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | for _ in range(input()):
x, y = map(int, raw_input().split())
if x >= y:
print "YES"
else:
if x == 2 and y in [1, 2, 3]:
print "YES"
elif x == 3 and y in [1, 2, 3]:
print "YES"
elif x > 3:
print "YES"
else:
print "NO" |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | /*
If you want to aim high, aim high
Don't let that studying and grades consume you
Just live life young
******************************
*/
import java.util.*;
import java.io.*;
public class B
{
public static void main(String args[]) throws Exception
{
BufferedReader infile = new BufferedRead... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner (System.in);
int t = sc.nextInt();
for(int c = 0; c < t; c++) {
int a = sc.nextInt(), b = sc.nextInt();
if(a == 2) {
a = 3;
}
if(a <= 3) {
System.out.println(a >= b ? "YES" : "NO");
... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | for _ in range(int(input())):
a,b = map(int,input().split())
if a == 1 and b >= 2:
print("NO")
elif a == 2 and b >= 4:
print("NO")
elif a == 3 and b >= 4:
print("NO")
else:
print('YES') |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
const int M = 1e6 + 10;
const long long INF = 0x3f3f3f3f3f3f3f;
const int inf = 0x3f3f3f;
const double esp = 1e-6;
long long read() {
long long x = 0;
long long k = 1;
char c = getchar();
while (c < '0' || c > '9') {
if (c == '-') k = -1;... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... |
t = int(input())
for query in range(t):
x, y = map(int, input().split())
if y<=x:
print('YES')
else:
found = False
while True:
if x%2==0 and x>= 3*x/2 - 1 and y>3*x/2:
break
if x%2==0:
x = 3*x/2
if x>=y:
... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | for _ in range(int(input())):
x, y = tuple(map(int, input().split()))
if x >= y:
print("YES")
elif (x in [1, 2, 3] and not(y in [1, 2, 3])) or x == 1:
print("NO")
else:
print("YES")
|
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | #include <bits/stdc++.h>
using namespace std;
long long sq(long long x) { return x * x; }
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
;
int t;
cin >> t;
while (t--) {
int x, y;
cin >> x >> y;
while (x < y && x != 3 && x != 1) {
if (x % 2 == 0)
x = 3 * (x /... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | #include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double pii = 2 * pi;
const double eps = 1e-6;
const long long MOD = 1e9 + 7;
void solve() {
long long x, y;
std::cin >> x >> y;
if (x == 1) {
if (y == 1) {
std::cout << "YES\n";
} else {
std::cout << "NO\n";
... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | for _ in range(int(input())):
x,y = map(int,input().split())
if(x>3):
print("YES")
elif(x == 1):
print("YES" if y == 1 else "NO")
else:
print("YES" if y<=3 else "NO") |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
long long x, y, temp;
cin >> x >> y;
temp = x;
if (x == y || (x > 1 && y <= x))
cout << "YES\n";
else if (x % 2 == 0 && x >= 4)
cout << "YES\n";
else if (x % 2 && x >= 5)
cout << "YE... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | import java.util.*;
import java.io.*;
public class b
{
public static void main(String[] args) { new b(); }
FS in = new FS();
PrintWriter out = new PrintWriter(System.out);
int t;
long x, y;
b() {
t = in.nextInt();
while (t --> 0) {
x = in.nextLong();
y = in.nextLong();
if (x == 1)
out.print... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | """
NTC here
"""
from sys import stdin
def iin(): return int(stdin.readline())
def lin(): return list(map(int, stdin.readline().split()))
# range = xrange
# input = raw_input
def main():
t=iin()
while t:
t-=1
x,y=lin()
if x<y:
if x==1:
print('NO')
... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | t=int(input())
for i in range(t):
x,y=map(int,input().split())
if x==1 and y==1:
print("YES")
elif x==1 and y!=1:
print("NO")
elif x==2 or x==3:
if y<4:
print("YES")
else:
print("NO")
continue
elif x>3:
print("YES")
else:
... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | #include <bits/stdc++.h>
using namespace std;
const long long mod = (long long)1e9 + 7;
const int INF = 0x3f3f3f3f;
const int MAXN = (int)1e4 + 10;
char s[MAXN], t[MAXN];
int main() {
int T;
cin >> T;
while (T--) {
int x, y;
cin >> x >> y;
bool flag = true;
if (x == 1) {
if (y != 1) flag = f... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | for i in range(int(input())):
a,b=input().split()
a,b=int(a),int(b)
ans=0
if(a>=b or a==2 and b==3):
ans=1
else:
if(a%2==0 and a>2):
ans=1
else:
p=a-1
k=3*p
... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | t = int(input())
ans = []
for i in range(t):
x, y = [int(s) for s in input().split()]
if x >= y:
ans.append('YES')
continue
if x == 1:
ans.append('NO')
continue
if x % 2 != 0:
x -=1
if 3*x//2 == y:
ans.append('YES')
continue
if 3*x//2 -1 != x or 3*x//2 == x:
ans.append('YES')
... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | t=int(input())
while t>0:
w=input().split()
x=int(w[0])
y=int(w[1])
if x>=y:
print("yes")
else:
if (x==3 or x==2) and y>=4:
print("no")
elif x==1 and y>1:
print("no")
else:
print("yes")
t-=1 |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;
public class MagicStick {
public static void main(String[]args) {
Scanner s = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
int t=s.nextInt();
while (t-->0) {
int x = ... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | T = int(input())
def solve(x, y):
if x >= 4:
return "YES"
if x in [2, 3]:
if y <= 3:
return "YES"
if x == 1:
if y == 1:
return "YES"
return "NO"
for case in range(T):
x, y = list(map(int, input().split()))
print(solve(x, y)) |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | t = int(input())
def solution(x, y):
if x == y:
return "YES"
elif x == 1 and y != 1:
return "NO"
elif x > y and x%2 == 0 and x > 1:
return "YES"
elif x > 3:
return "YES"
elif x == 2 or x == 3:
if y not in [1, 2, 3]:
return "NO"
else:
... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | t = int(input())
for _ in range(t):
x, y = map(int, input().split())
if x == 1 and y != 1:
print("NO")
elif x <= 3 and y > 3:
print("NO")
else:
print("YES")
|
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | t = int(input())
for _ in range(t) :
x, y = map(int,input().split())
s = x
d = dict()
while s < y :
if x==1:
break
d[s] = 1
if s%2==0 :
s = s//2
s = s*3
else :
s = s-1
if s in d.keys() :
break
... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | import java.util.Scanner;
public class Main {
static final int[] SMALL_LIMITS = { -1, 1, 3, 3 };
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for (int tc = 0; tc < T; tc++) {
int x = sc.nextInt();
int y = sc.nextInt();
System.out.println(solve(... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | test_cases = int(input())
data = []
while test_cases > 0:
data.append(list(map(int,input().split())))
test_cases -= 1
for i in range (0,len(data)):
if data[i][0] <=3:
if (data[i][1] <= data[i][0]) or (data[i][0] == 2 and data[i][1] == 3):
print('YES')
else:
print('NO... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | for _ in range(int(input())):
x, y = map(int, input().split())
if x == 1:
print('YES' if y <= x else 'NO')
elif x <= 3:
print('YES' if y <= 3 else 'NO')
else:
print('YES')
|
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | #include <bits/stdc++.h>
int main() {
int T;
scanf("%d", &T);
while (T--) {
int x, y;
scanf("%d%d", &x, &y);
puts(x == y ? "YES"
: x == 1 ? "NO"
: (x - (x & 1) == 2) ? (y > 3 ? "NO" : "YES")
: "YES");
}
}
|
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | T = int(input())
for t in range(T):
x, y = map(int, input().split())
if x == 1 and y != 1:
print("NO")
elif x == 2 or x == 3:
if y > 3:
print("NO")
else:
print("YES")
else:
print("YES")
|
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | # !/usr/bin/env python3
# encoding: UTF-8
# Last Modified: 13/Nov/19 08:15:24 PM
import sys
def main():
for tc in range(int(input())):
x, y = get_ints()
if x == 1 and y > x:
print("NO")
continue
if x <= 3 and y > 3:
print("NO")
con... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | t=int(input())
for a0 in range(t):
x,y=map(int,input().split())
if x==1 and y>1:
print("NO")
elif (x==2 or x==3) and y>=4:
print("NO")
else:
print("YES") |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... |
n = int(input());
for i in range(n):
a, b = [int(x) for x in input().split()]
if a <= 3 and b > 3:
print("no")
elif a == 1 and b != 1:
print("no")
else:
print("yes") |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long t;
cin >> t;
for (long long i = 0; i < t; i++) {
long long x, y;
cin >> x >> y;
if (x == y) {
cout << "YES\n";
continue;
} else if (x == 1) {
cout << "NO\n";
continue;
} else if ((x == 3 or x == 2) and... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | for _ in range(int(input())) :
x,y = map(int,input().split())
if x>=y :
print('YES')
elif x == 1 :
print('NO')
elif x == 2 and y != 3 :
print('NO')
elif x == 3 and y != 2 :
print('NO')
else :
print('YES')
|
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | for _ in range(int(input())):
x,y= map(int,input().split())
f=1
if x>=y:
f=1
else:
p=x
while x<y:
if x%2==0:
x = (3*x)//2
if x<=p:
f=0
break
else:
x = x-1
... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | import math
t = int(input())
def hello():
x, y = map(int, input().split())
if x == 1 and y != 1:
return "NO"
if (x == 2 or x == 3) and y > 3:
return "NO"
else:
return "YES"
for i in range(t):
print(hello()) |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: bekzat
"""
t = int(input())
ans = []
for number in range(t):
x, y = map(int, input().split())
if x >= y or x > 3 or (x % 2 ==0 and x * (3/2) >= y) or (x % 2 == 1 and (x-1) * (3/2) >= y):
ans.append("YES")
else:
ans.append("NO")
... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... |
if __name__ == '__main__':
t = int(input())
for i in range(t):
x, y = map(int, input().split(' '))
if x >= y:
print("YES")
elif x == 1:
print("NO")
else:
q = x
if x % 2 == 0:
x = int(x/2) * 3
if x ==... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | t=int(input())
for i in range(t):
x,y=map(int,input().split())
if(y<x or y==x):
print("YES")
else:
if(x==3 or x==1):
print("NO")
elif(x==2 and y>3):
print("NO")
else:
print("YES") |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | t = int(input())
for case in range(t):
x, y = [int(x) for x in input().split()]
if x >= y:
print("YES")
else:
if x == 2 and y == 3:
print("YES")
elif x <= 3:
print("NO")
else:
print("YES")
|
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | #include <bits/stdc++.h>
using namespace std;
long long int const LINF = numeric_limits<long long int>::max();
int const INF = numeric_limits<int>::max();
long long int gcd(long long int a, long long int b) {
return b ? gcd(b, a % b) : a;
}
long long int pow_mod(long long int a, long long int e, long long int m) {
... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
long long t;
cin >> t;
for (int test = 0; test < t; test++) {
long long x, y;
cin >> x >> y;
if (x >= 4) {
cout << "YES" << endl;
} else {
if (y < 4 && x > 1) {
cout ... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | t = input()
for w in xrange(t):
x, y = map(int, raw_input().split())
if (x==1 and y!=1) or ((x==2 or x==3) and y not in [1, 2, 3]):
print "NO"
else:
print "YES" |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | import java.io.*;
public class Solution {
public static void main(String []args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int not = Integer.parseInt(br.readLine());
while(not--!=0) {
String input[] = br.readLine().split(" ");
... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | ans = []
for TT in range(1, int(input()) + 1):
x, y = map(int, input().split())
res = True
if x in {2, 3}:
res &= y <= 3
elif x == 1:
res &= y == 1
ans.append("Yes" if res else "No")
print('\n'.join(ans)) |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | #include <bits/stdc++.h>
using namespace std;
long long i, j, k, l, n, m, a, b, x;
int main() {
int nt;
cin >> nt;
while (nt--) {
cin >> a >> b;
if (a == 1 && b != 1) {
cout << "NO" << '\n';
continue;
}
if (a < 4 && b > 3)
cout << "NO" << '\n';
else
cout << "YES" << '\n... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | t = int(input())
for _ in range(t):
xy = list(map(int, input().rstrip().split()))
x = xy[0]
y = xy[1]
if x >= y:
print('YES')
elif x == 2 and y == 3:
print('YES')
elif x == 1 or x == 3 or x == 2:
print('NO')
else:
print('YES') |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | def examB():
T = I()
for _ in range(T):
x, y = LI()
if x==1 and y!=1:
ans = "NO"
elif x<=3 and y>=4:
ans = "NO"
else:
ans = "YES"
print(ans)
import sys
import copy
import bisect
import heapq
from collections import Counter,defaultdict,... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | t=int(input())
for _ in range(t):
x,y=map(int,input().split())
if(x==1):
if(y==1):
print("YES")
else:
print("NO")
elif(x<=3):
if(y<=3):
print("YES")
else:
print("NO")
else:
print("YES") |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | #include <bits/stdc++.h>
using namespace std;
bool solve(long long int x, long long int y) {
if (x >= y) {
return true;
}
if (x == 1) {
return false;
}
if (x == 2) {
if (y == 3) {
return true;
}
return false;
}
if (x == 3) {
return solve(x - 1, y);
}
return true;
}
int ma... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | t=int(input())
while t>0:
x,y=input().split()
t-=1
x=int(x)
y=int(y)
if x>=y:
print("YES")
elif x>3:
print("YES")
elif x==2 and y==3:
print("YES")
else:
print("NO")
|
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | for _ in range(int(input())):
x, y = list(map(int, input().split()))
if y == 1 or y < x:
print("YES")
continue
if x == 1:
print("NO")
continue
if x < 4 and y >= 4:
print("NO")
continue
print("YES") |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | for step in range(int(input())):
x,y=map(int,input().split())
if x>=y:
print("YES")
elif x>=4:
print("YES")
elif x==1:
print("NO")
elif x==2 and (y==3 or y==1):
print("YES")
elif x==3 and (y==2 or y==1):
print("YES")
else:
print("NO") |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | for _ in range(int(input())):
x,y = map(int,input().split())
if(x==3 and (y>3)): print("NO")
elif(x==1 and y!=1): print("NO")
elif(x==2 and (y>3)): print("NO")
else: print("YES")
|
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | import time
t = int(input())
for _ in range(t):
msg = 'YES'
x,y = map(int,input().split(" "))
while msg=='YES' and x!=y:
if (x<=3 and y>3) or (x==1 and y>1):
msg='NO'
elif x>y:
x=y
elif x%2==0:
x = x*3/2
else:
x... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | # cook your dish here
for _ in range(int(input())):
x,y=map(int,input().split())
if(x==1):
if(y==1):
print("YES")
else:
print("NO")
elif(x==2):
if(y==1 or y==2 or y==3):
print("YES")
else:
print("NO")
elif(x==3):
if(... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
long long int t;
cin >> t;
while (t--) {
long long int x, y;
cin >> x >> y;
if (x >= y) {
cout << "YES" << endl;
} else if (x == 1 || x == 3) {
cout << "NO" << endl;
} el... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | for i in range(int(input())):
a = list(map(int,input().split()))
if (a[0] == 1 and a[1] != 1) or (a[0] < 4 and a[1] > 3) :
print('No')
else:
print('Yes') |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | t = int(input())
for i in range(t):
x, y = map(int,input().split())
if x > y:
print('YES')
else:
if x < 4:
if (x == y) or (y == 3 and x == 2): print('YES')
else: print('NO')
else:
print('YES') |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | T = int(raw_input())
for t in range(T):
x, y = list(map(int, raw_input().split()))
if x==1:
res = y == 1
elif x in [2, 3]:
res = y in [1, 2, 3]
else:
res = True
res = "YES" if res else "NO"
print(res) |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | t = int(input())
for _ in range(t):
x, y = map(int, input().split())
flag = False
if y <= x:
print('YES')
continue
while x > 0:
if x%2 == 0:
temp = (x//2)*3
else:
temp = ((x-1)//2)*3
if temp == x:
break
else:
... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | for _ in range(int(input())):
x,y=map(int,input().split())
c=0
if x>=4:
print("YES")
elif x==3 and y<=3:
print("YES")
elif x==2 and y<=3:
print("YES")
elif x==1 and y==1:
print("YES")
else:
print("NO")
|
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
bool isp(int long n) {
for (int i = 2; i * i <= n; i++)
if (n % i == 0) return false;
return true;
}
ll MOD = 1000000007;
const int SINF = 1000000009;
const ll INF = 1000000000000000018;
template <typename T>
void toInt(... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... |
t = int(input())
for _ in range(t):
x, y = map(int, input().split())
if x >= y:
print('YES')
else:
if x == 1 or (x <= 3 and y > 3):
print('NO')
else:
print('YES')
|
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | n = int(input())
for i in range(n):
x, y = map(int, input().split())
if x == 1 and y ==1:
print('YES')
elif x == 2 and y in [1,2,3]:
print('YES')
elif x == 3 and y in [1,2,3]:
print('YES')
elif x > 3:
print('YES')
else:
print('NO')
|
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | #include <bits/stdc++.h>
using namespace std;
const long long int N = 2e5 + 5;
void solve() {
long long int a, b;
cin >> a >> b;
if (a >= b) {
cout << "YES"
<< "\n";
return;
} else {
if (a == 1) {
cout << "NO"
<< "\n";
return;
} else if (a == 2 || a == 3) {
... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int x, y;
cin >> x >> y;
if (x >= 4) {
cout << "yes" << endl;
continue;
}
if (x == 1) {
if (y == 1)
cout << "yes" << endl;
else
cout << "no" << endl;
continue... |
Problem: Recently Petya walked in the forest and found a magic stick.
Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
1. If the chosen number a is even, then the spell will turn it into 3a/2;
... | #include <bits/stdc++.h>
using namespace std;
long long n, t, x, a, b;
int main() {
cin >> t;
while (t--) {
cin >> a >> b;
if (a >= b)
cout << "YES" << endl;
else if (a < b && a <= 3 && a * 1.5 != b)
cout << "NO" << endl;
else
cout << "YES" << endl;
}
return 0;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.