message
stringlengths
2
44.5k
message_type
stringclasses
2 values
message_id
int64
0
1
conversation_id
int64
42
109k
cluster
float64
5
5
__index_level_0__
int64
84
217k
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given a positive integer n. Let S(x) be sum of digits in base 10 representation of x, for example, S(123) = 1 + 2 + 3 = 6, S(0) = 0. Your task is to find two integers a, b, such that 0 ≤ a, b ≤ n, a + b = n and S(a) + S(b) is the largest possible among all such pairs. Input The only line of input contains an integer n (1 ≤ n ≤ 10^{12}). Output Print largest S(a) + S(b) among all pairs of integers a, b, such that 0 ≤ a, b ≤ n and a + b = n. Examples Input 35 Output 17 Input 10000000000 Output 91 Note In the first example, you can choose, for example, a = 17 and b = 18, so that S(17) + S(18) = 1 + 7 + 1 + 8 = 17. It can be shown that it is impossible to get a larger answer. In the second test example, you can choose, for example, a = 5000000001 and b = 4999999999, with S(5000000001) + S(4999999999) = 91. It can be shown that it is impossible to get a larger answer. Submitted Solution: ``` n=int(input()) k=str(n) q=len(k) if q>1: l=k[1:n] l=str(int(l)+1) p=str(n-int(l)) s=0 h=len(l) o=len(p) for i in range (h): s=s+int(l[i]) for j in range (o): s=s+int(p[j]) else : s=n print(s) ```
instruction
0
18,578
5
37,156
Yes
output
1
18,578
5
37,157
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given a positive integer n. Let S(x) be sum of digits in base 10 representation of x, for example, S(123) = 1 + 2 + 3 = 6, S(0) = 0. Your task is to find two integers a, b, such that 0 ≤ a, b ≤ n, a + b = n and S(a) + S(b) is the largest possible among all such pairs. Input The only line of input contains an integer n (1 ≤ n ≤ 10^{12}). Output Print largest S(a) + S(b) among all pairs of integers a, b, such that 0 ≤ a, b ≤ n and a + b = n. Examples Input 35 Output 17 Input 10000000000 Output 91 Note In the first example, you can choose, for example, a = 17 and b = 18, so that S(17) + S(18) = 1 + 7 + 1 + 8 = 17. It can be shown that it is impossible to get a larger answer. In the second test example, you can choose, for example, a = 5000000001 and b = 4999999999, with S(5000000001) + S(4999999999) = 91. It can be shown that it is impossible to get a larger answer. Submitted Solution: ``` n = input() if len(n) == 1: print(n) exit() num1 = '9'*(len(n)-1) print(9*len(num1)+sum(map(int,str(int(n)-int(num1))))) ```
instruction
0
18,579
5
37,158
Yes
output
1
18,579
5
37,159
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given a positive integer n. Let S(x) be sum of digits in base 10 representation of x, for example, S(123) = 1 + 2 + 3 = 6, S(0) = 0. Your task is to find two integers a, b, such that 0 ≤ a, b ≤ n, a + b = n and S(a) + S(b) is the largest possible among all such pairs. Input The only line of input contains an integer n (1 ≤ n ≤ 10^{12}). Output Print largest S(a) + S(b) among all pairs of integers a, b, such that 0 ≤ a, b ≤ n and a + b = n. Examples Input 35 Output 17 Input 10000000000 Output 91 Note In the first example, you can choose, for example, a = 17 and b = 18, so that S(17) + S(18) = 1 + 7 + 1 + 8 = 17. It can be shown that it is impossible to get a larger answer. In the second test example, you can choose, for example, a = 5000000001 and b = 4999999999, with S(5000000001) + S(4999999999) = 91. It can be shown that it is impossible to get a larger answer. Submitted Solution: ``` def f(a,b): res = 0 for i in a: res += int(i) for i in b: res += int(i) return res n = int(input()) if n<18: print(n) exit() elif n<100: t=0 a = n//10 if n%10!=0: t = a*10-1 else: t = n-1 v = n-t res = f(str(t),str(v)) print(res) else: k = str(n) t = "9"*(len(k)-1) t = int(t) v = n-t print(f(str(v),str(t))) ```
instruction
0
18,580
5
37,160
Yes
output
1
18,580
5
37,161
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given a positive integer n. Let S(x) be sum of digits in base 10 representation of x, for example, S(123) = 1 + 2 + 3 = 6, S(0) = 0. Your task is to find two integers a, b, such that 0 ≤ a, b ≤ n, a + b = n and S(a) + S(b) is the largest possible among all such pairs. Input The only line of input contains an integer n (1 ≤ n ≤ 10^{12}). Output Print largest S(a) + S(b) among all pairs of integers a, b, such that 0 ≤ a, b ≤ n and a + b = n. Examples Input 35 Output 17 Input 10000000000 Output 91 Note In the first example, you can choose, for example, a = 17 and b = 18, so that S(17) + S(18) = 1 + 7 + 1 + 8 = 17. It can be shown that it is impossible to get a larger answer. In the second test example, you can choose, for example, a = 5000000001 and b = 4999999999, with S(5000000001) + S(4999999999) = 91. It can be shown that it is impossible to get a larger answer. Submitted Solution: ``` n = int(input()) a = 9 while n>a: a = 10*a +9 a//=10 b = n-a #print(a,b) print(sum(map(int,str(a)))+sum(map(int,str(b)))) ```
instruction
0
18,581
5
37,162
Yes
output
1
18,581
5
37,163
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given a positive integer n. Let S(x) be sum of digits in base 10 representation of x, for example, S(123) = 1 + 2 + 3 = 6, S(0) = 0. Your task is to find two integers a, b, such that 0 ≤ a, b ≤ n, a + b = n and S(a) + S(b) is the largest possible among all such pairs. Input The only line of input contains an integer n (1 ≤ n ≤ 10^{12}). Output Print largest S(a) + S(b) among all pairs of integers a, b, such that 0 ≤ a, b ≤ n and a + b = n. Examples Input 35 Output 17 Input 10000000000 Output 91 Note In the first example, you can choose, for example, a = 17 and b = 18, so that S(17) + S(18) = 1 + 7 + 1 + 8 = 17. It can be shown that it is impossible to get a larger answer. In the second test example, you can choose, for example, a = 5000000001 and b = 4999999999, with S(5000000001) + S(4999999999) = 91. It can be shown that it is impossible to get a larger answer. Submitted Solution: ``` from sys import stdin, stdout from bisect import bisect_left, bisect_right from collections import defaultdict import math from fractions import Fraction as frac from random import random cin = stdin.readline def cout(x): stdout.write(str(x)+'\n') def var(type = int): return type(stdin.readline()) def readline(type = int): return map(type,stdin.readline().split()) def readlist(type = int): return list(map(type,stdin.readline().split())) def sorted_indexes(arr): return sorted(range(len(arr)),key=arr.__getitem__) def printr(arr): [stdout.write(str(x)+' ') for x in arr] cout('') def find_lt(a, x):#'Find rightmost value less than x' i = bisect_left(a, x) if i: return a[i-1] raise ValueError def find_gt(a, x):#'Find leftmost value greater than x' i = bisect_right(a, x) if i != len(a): return a[i] raise ValueError def dist(x,y): return math.sqrt(x*x + y*y) def binary_search(arr, x): i = bisect_left(arr, x) if i == len(arr) or arr[i] != x: return -1 return i MOD2 = 998244353 #----------------FUncs def sm(x): x = str(x) s = 0 for n in x: s += int(n) return s # -------------------------sdpt,sdpt131[Sudipta Banik]--------------------- n = var() a = n//2 b = n-a if a == b: a+=1 b-=1 print(sm(a)+sm(b)) ```
instruction
0
18,582
5
37,164
No
output
1
18,582
5
37,165
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given a positive integer n. Let S(x) be sum of digits in base 10 representation of x, for example, S(123) = 1 + 2 + 3 = 6, S(0) = 0. Your task is to find two integers a, b, such that 0 ≤ a, b ≤ n, a + b = n and S(a) + S(b) is the largest possible among all such pairs. Input The only line of input contains an integer n (1 ≤ n ≤ 10^{12}). Output Print largest S(a) + S(b) among all pairs of integers a, b, such that 0 ≤ a, b ≤ n and a + b = n. Examples Input 35 Output 17 Input 10000000000 Output 91 Note In the first example, you can choose, for example, a = 17 and b = 18, so that S(17) + S(18) = 1 + 7 + 1 + 8 = 17. It can be shown that it is impossible to get a larger answer. In the second test example, you can choose, for example, a = 5000000001 and b = 4999999999, with S(5000000001) + S(4999999999) = 91. It can be shown that it is impossible to get a larger answer. Submitted Solution: ``` def digitSum(x): s = 0 while x != 0: s += x % 10 x = (x//10) return s n = int(input()) if n % 2 == 0: l = h = n//2 else: l = n // 2 h = l + 1 s = digitSum(l) s += digitSum(h) t = digitSum(l-1) t += digitSum(h+1) if t > s: print(t) else: print(s) ```
instruction
0
18,583
5
37,166
No
output
1
18,583
5
37,167
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given a positive integer n. Let S(x) be sum of digits in base 10 representation of x, for example, S(123) = 1 + 2 + 3 = 6, S(0) = 0. Your task is to find two integers a, b, such that 0 ≤ a, b ≤ n, a + b = n and S(a) + S(b) is the largest possible among all such pairs. Input The only line of input contains an integer n (1 ≤ n ≤ 10^{12}). Output Print largest S(a) + S(b) among all pairs of integers a, b, such that 0 ≤ a, b ≤ n and a + b = n. Examples Input 35 Output 17 Input 10000000000 Output 91 Note In the first example, you can choose, for example, a = 17 and b = 18, so that S(17) + S(18) = 1 + 7 + 1 + 8 = 17. It can be shown that it is impossible to get a larger answer. In the second test example, you can choose, for example, a = 5000000001 and b = 4999999999, with S(5000000001) + S(4999999999) = 91. It can be shown that it is impossible to get a larger answer. Submitted Solution: ``` n=int(input()) sumn=0 sumb=0 a=n//2-1 b=n//2 if n%2==1: l=str(str(a)+str(b)) for x in range(len(l)): sumn+=int(l[x]) print(sumn) else: l=str(str(a)+str(b)) for x in range(len(l)): sumb+=int(l[x]) print(sumb) ```
instruction
0
18,584
5
37,168
No
output
1
18,584
5
37,169
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given a positive integer n. Let S(x) be sum of digits in base 10 representation of x, for example, S(123) = 1 + 2 + 3 = 6, S(0) = 0. Your task is to find two integers a, b, such that 0 ≤ a, b ≤ n, a + b = n and S(a) + S(b) is the largest possible among all such pairs. Input The only line of input contains an integer n (1 ≤ n ≤ 10^{12}). Output Print largest S(a) + S(b) among all pairs of integers a, b, such that 0 ≤ a, b ≤ n and a + b = n. Examples Input 35 Output 17 Input 10000000000 Output 91 Note In the first example, you can choose, for example, a = 17 and b = 18, so that S(17) + S(18) = 1 + 7 + 1 + 8 = 17. It can be shown that it is impossible to get a larger answer. In the second test example, you can choose, for example, a = 5000000001 and b = 4999999999, with S(5000000001) + S(4999999999) = 91. It can be shown that it is impossible to get a larger answer. Submitted Solution: ``` def S(x): sum=0 a =str(x) for f in a: sum+=int(f) return sum a=int(input()) x=round ((a/2)-1) y=a-x print(S(x)+S(y)) ```
instruction
0
18,585
5
37,170
No
output
1
18,585
5
37,171
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Bessie and the cows are playing with sequences and need your help. They start with a sequence, initially containing just the number 0, and perform n operations. Each operation is one of the following: 1. Add the integer xi to the first ai elements of the sequence. 2. Append an integer ki to the end of the sequence. (And hence the size of the sequence increases by 1) 3. Remove the last element of the sequence. So, the size of the sequence decreases by one. Note, that this operation can only be done if there are at least two elements in the sequence. After each operation, the cows would like to know the average of all the numbers in the sequence. Help them! Input The first line contains a single integer n (1 ≤ n ≤ 2·105) — the number of operations. The next n lines describe the operations. Each line will start with an integer ti (1 ≤ ti ≤ 3), denoting the type of the operation (see above). If ti = 1, it will be followed by two integers ai, xi (|xi| ≤ 103; 1 ≤ ai). If ti = 2, it will be followed by a single integer ki (|ki| ≤ 103). If ti = 3, it will not be followed by anything. It is guaranteed that all operations are correct (don't touch nonexistent elements) and that there will always be at least one element in the sequence. Output Output n lines each containing the average of the numbers in the sequence after the corresponding operation. The answer will be considered correct if its absolute or relative error doesn't exceed 10 - 6. Examples Input 5 2 1 3 2 3 2 1 3 Output 0.500000 0.000000 1.500000 1.333333 1.500000 Input 6 2 1 1 2 20 2 2 1 2 -3 3 3 Output 0.500000 20.500000 14.333333 12.333333 17.500000 17.000000 Note In the second sample, the sequence becomes <image> Submitted Solution: ``` #------------------------template--------------------------# import os import sys from math import * from collections import * from fractions import * from bisect import * from heapq 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): newlines = 0 def __init__(self, file): self._fd = file.fileno() self.buffer = BytesIO() self.writable = "x" in file.mode or "r" not in file.mode self.write = self.buffer.write if self.writable else None def read(self): while True: b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE)) if not b: break ptr = self.buffer.tell() self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr) self.newlines = 0 return self.buffer.read() def readline(self): while self.newlines == 0: b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE)) self.newlines = b.count(b"\n") + (not b) ptr = self.buffer.tell() self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr) self.newlines -= 1 return self.buffer.readline() def flush(self): if self.writable: os.write(self._fd, self.buffer.getvalue()) self.buffer.truncate(0), self.buffer.seek(0) class IOWrapper(IOBase): def __init__(self, file): self.buffer = FastIO(file) self.flush = self.buffer.flush self.writable = self.buffer.writable self.write = lambda s: self.buffer.write(s.encode("ascii")) self.read = lambda: self.buffer.read().decode("ascii") self.readline = lambda: self.buffer.readline().decode("ascii") sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout) input = lambda: sys.stdin.readline().rstrip("\r\n") ALPHA='abcdefghijklmnopqrstuvwxyz' M=10**9+7 EPS=1e-6 def value():return tuple(map(int,input().split())) def array():return [int(i) for i in input().split()] def Int():return int(input()) def Str():return input() def arrayS():return [i for i in input().split()] #-------------------------code---------------------------# # vsInput() n=Int() s=0 top=[0] for i in range(n): query=input() if(query[0]=='1'): _,a,x=[int(i) for i in query.split()] s+=a*x top[-1]+=x elif(query[0]=='2'): _,x=[int(i) for i in query.split()] s+=x top[-1]-=x top.append(x) else: ele=top.pop() s-=ele top[-1]+=ele print(s/len(top)) ```
instruction
0
18,849
5
37,698
No
output
1
18,849
5
37,699
Provide a correct Python 3 solution for this coding contest problem. Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. Given an integer N, determine whether N can be represented as the product of two integers between 1 and 9. If it can, print `Yes`; if it cannot, print `No`. Constraints * 1 \leq N \leq 100 * N is an integer. Input Input is given from Standard Input in the following format: N Output If N can be represented as the product of two integers between 1 and 9 (inclusive), print `Yes`; if it cannot, print `No`. Examples Input 10 Output Yes Input 50 Output No Input 81 Output Yes
instruction
0
19,154
5
38,308
"Correct Solution: ``` N = int(input()) k = set([i*j for i in range(10) for j in range(10)]) print("Yes" if N in k else "No") ```
output
1
19,154
5
38,309
Provide a correct Python 3 solution for this coding contest problem. Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. Given an integer N, determine whether N can be represented as the product of two integers between 1 and 9. If it can, print `Yes`; if it cannot, print `No`. Constraints * 1 \leq N \leq 100 * N is an integer. Input Input is given from Standard Input in the following format: N Output If N can be represented as the product of two integers between 1 and 9 (inclusive), print `Yes`; if it cannot, print `No`. Examples Input 10 Output Yes Input 50 Output No Input 81 Output Yes
instruction
0
19,155
5
38,310
"Correct Solution: ``` n = int(input()) ans = {i*j for i in range(1,10) for j in range(1,10)} if n in ans:print("Yes") else:print("No") ```
output
1
19,155
5
38,311
Provide a correct Python 3 solution for this coding contest problem. Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. Given an integer N, determine whether N can be represented as the product of two integers between 1 and 9. If it can, print `Yes`; if it cannot, print `No`. Constraints * 1 \leq N \leq 100 * N is an integer. Input Input is given from Standard Input in the following format: N Output If N can be represented as the product of two integers between 1 and 9 (inclusive), print `Yes`; if it cannot, print `No`. Examples Input 10 Output Yes Input 50 Output No Input 81 Output Yes
instruction
0
19,156
5
38,312
"Correct Solution: ``` x=int(input()) t=0 for i in range(1,10): if x%i==0 and x//i<10: t=1 if t==1: print('Yes') else: print('No') ```
output
1
19,156
5
38,313
Provide a correct Python 3 solution for this coding contest problem. Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. Given an integer N, determine whether N can be represented as the product of two integers between 1 and 9. If it can, print `Yes`; if it cannot, print `No`. Constraints * 1 \leq N \leq 100 * N is an integer. Input Input is given from Standard Input in the following format: N Output If N can be represented as the product of two integers between 1 and 9 (inclusive), print `Yes`; if it cannot, print `No`. Examples Input 10 Output Yes Input 50 Output No Input 81 Output Yes
instruction
0
19,157
5
38,314
"Correct Solution: ``` N = int(input()) ans = "No" for a in range(10): for b in range(10): if N==a*b:ans="Yes" print(ans) ```
output
1
19,157
5
38,315
Provide a correct Python 3 solution for this coding contest problem. Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. Given an integer N, determine whether N can be represented as the product of two integers between 1 and 9. If it can, print `Yes`; if it cannot, print `No`. Constraints * 1 \leq N \leq 100 * N is an integer. Input Input is given from Standard Input in the following format: N Output If N can be represented as the product of two integers between 1 and 9 (inclusive), print `Yes`; if it cannot, print `No`. Examples Input 10 Output Yes Input 50 Output No Input 81 Output Yes
instruction
0
19,158
5
38,316
"Correct Solution: ``` n = int(input()) kuku = {i * j for i in range(1, 10) for j in range(1, 10)} print('Yes' if n in kuku else 'No') ```
output
1
19,158
5
38,317
Provide a correct Python 3 solution for this coding contest problem. Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. Given an integer N, determine whether N can be represented as the product of two integers between 1 and 9. If it can, print `Yes`; if it cannot, print `No`. Constraints * 1 \leq N \leq 100 * N is an integer. Input Input is given from Standard Input in the following format: N Output If N can be represented as the product of two integers between 1 and 9 (inclusive), print `Yes`; if it cannot, print `No`. Examples Input 10 Output Yes Input 50 Output No Input 81 Output Yes
instruction
0
19,159
5
38,318
"Correct Solution: ``` a = int(input()) for i in range(9): if(a%(i+1) ==0 and a/(i+1)<=9): print("Yes") exit() print("No") ```
output
1
19,159
5
38,319
Provide a correct Python 3 solution for this coding contest problem. Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. Given an integer N, determine whether N can be represented as the product of two integers between 1 and 9. If it can, print `Yes`; if it cannot, print `No`. Constraints * 1 \leq N \leq 100 * N is an integer. Input Input is given from Standard Input in the following format: N Output If N can be represented as the product of two integers between 1 and 9 (inclusive), print `Yes`; if it cannot, print `No`. Examples Input 10 Output Yes Input 50 Output No Input 81 Output Yes
instruction
0
19,160
5
38,320
"Correct Solution: ``` x=int(input()) for i in range(1,10): if x%i==0: if x/i<10: print('Yes');exit() print('No') ```
output
1
19,160
5
38,321
Provide a correct Python 3 solution for this coding contest problem. Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. Given an integer N, determine whether N can be represented as the product of two integers between 1 and 9. If it can, print `Yes`; if it cannot, print `No`. Constraints * 1 \leq N \leq 100 * N is an integer. Input Input is given from Standard Input in the following format: N Output If N can be represented as the product of two integers between 1 and 9 (inclusive), print `Yes`; if it cannot, print `No`. Examples Input 10 Output Yes Input 50 Output No Input 81 Output Yes
instruction
0
19,161
5
38,322
"Correct Solution: ``` if int(input()) in [i*j for i in range(10) for j in range(10)]: print("Yes") else: print("No") ```
output
1
19,161
5
38,323
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. Given an integer N, determine whether N can be represented as the product of two integers between 1 and 9. If it can, print `Yes`; if it cannot, print `No`. Constraints * 1 \leq N \leq 100 * N is an integer. Input Input is given from Standard Input in the following format: N Output If N can be represented as the product of two integers between 1 and 9 (inclusive), print `Yes`; if it cannot, print `No`. Examples Input 10 Output Yes Input 50 Output No Input 81 Output Yes Submitted Solution: ``` N=int(input()) for i in range(1,10): for j in range(1,10): if i*j==N: print("Yes") exit() print("No") ```
instruction
0
19,162
5
38,324
Yes
output
1
19,162
5
38,325
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. Given an integer N, determine whether N can be represented as the product of two integers between 1 and 9. If it can, print `Yes`; if it cannot, print `No`. Constraints * 1 \leq N \leq 100 * N is an integer. Input Input is given from Standard Input in the following format: N Output If N can be represented as the product of two integers between 1 and 9 (inclusive), print `Yes`; if it cannot, print `No`. Examples Input 10 Output Yes Input 50 Output No Input 81 Output Yes Submitted Solution: ``` num = int(input()) if num in [i*j for i in range(1,10) for j in range(1,10)]: print("Yes") else: print("No") ```
instruction
0
19,163
5
38,326
Yes
output
1
19,163
5
38,327
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. Given an integer N, determine whether N can be represented as the product of two integers between 1 and 9. If it can, print `Yes`; if it cannot, print `No`. Constraints * 1 \leq N \leq 100 * N is an integer. Input Input is given from Standard Input in the following format: N Output If N can be represented as the product of two integers between 1 and 9 (inclusive), print `Yes`; if it cannot, print `No`. Examples Input 10 Output Yes Input 50 Output No Input 81 Output Yes Submitted Solution: ``` N = int(input()) for i in range(1, 10): if N%i == 0 and N//i <= 9: print("Yes") exit() print("No") ```
instruction
0
19,164
5
38,328
Yes
output
1
19,164
5
38,329
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. Given an integer N, determine whether N can be represented as the product of two integers between 1 and 9. If it can, print `Yes`; if it cannot, print `No`. Constraints * 1 \leq N \leq 100 * N is an integer. Input Input is given from Standard Input in the following format: N Output If N can be represented as the product of two integers between 1 and 9 (inclusive), print `Yes`; if it cannot, print `No`. Examples Input 10 Output Yes Input 50 Output No Input 81 Output Yes Submitted Solution: ``` n=int(input()) d=set([i*j for i in range(1,10) for j in range(1,10)]) print("Yes" if n in d else "No") ```
instruction
0
19,165
5
38,330
Yes
output
1
19,165
5
38,331
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. Given an integer N, determine whether N can be represented as the product of two integers between 1 and 9. If it can, print `Yes`; if it cannot, print `No`. Constraints * 1 \leq N \leq 100 * N is an integer. Input Input is given from Standard Input in the following format: N Output If N can be represented as the product of two integers between 1 and 9 (inclusive), print `Yes`; if it cannot, print `No`. Examples Input 10 Output Yes Input 50 Output No Input 81 Output Yes Submitted Solution: ``` n=int(input()) i=1 l=0 while i<10: if n/i==n//i and n//i<9: l=l+1 i=i+1 print("yes" if l>0 else "no") ```
instruction
0
19,166
5
38,332
No
output
1
19,166
5
38,333
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. Given an integer N, determine whether N can be represented as the product of two integers between 1 and 9. If it can, print `Yes`; if it cannot, print `No`. Constraints * 1 \leq N \leq 100 * N is an integer. Input Input is given from Standard Input in the following format: N Output If N can be represented as the product of two integers between 1 and 9 (inclusive), print `Yes`; if it cannot, print `No`. Examples Input 10 Output Yes Input 50 Output No Input 81 Output Yes Submitted Solution: ``` l = [0]*100 for i in range(1, 10): for j in range(1, 10): l[i*j] = 1 n = int(input()) if l[n] == 1: print("Yes") else: print("No") ```
instruction
0
19,167
5
38,334
No
output
1
19,167
5
38,335
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. Given an integer N, determine whether N can be represented as the product of two integers between 1 and 9. If it can, print `Yes`; if it cannot, print `No`. Constraints * 1 \leq N \leq 100 * N is an integer. Input Input is given from Standard Input in the following format: N Output If N can be represented as the product of two integers between 1 and 9 (inclusive), print `Yes`; if it cannot, print `No`. Examples Input 10 Output Yes Input 50 Output No Input 81 Output Yes Submitted Solution: ``` n = int(input()) ans="No" for i in range(1,n+1): for j in range(1,n+1): if i*j == n: ans = "Yes" break print(ans) ```
instruction
0
19,168
5
38,336
No
output
1
19,168
5
38,337
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. Given an integer N, determine whether N can be represented as the product of two integers between 1 and 9. If it can, print `Yes`; if it cannot, print `No`. Constraints * 1 \leq N \leq 100 * N is an integer. Input Input is given from Standard Input in the following format: N Output If N can be represented as the product of two integers between 1 and 9 (inclusive), print `Yes`; if it cannot, print `No`. Examples Input 10 Output Yes Input 50 Output No Input 81 Output Yes Submitted Solution: ``` x=int(input()) flg=0 for i in range(2,10): if x%i==0 and x//i<10: x//=i flg=1 if flg: print('Yes') else: print('No') ```
instruction
0
19,169
5
38,338
No
output
1
19,169
5
38,339
Provide a correct Python 3 solution for this coding contest problem. AtCoDeer the deer has found two positive integers, a and b. Determine whether the concatenation of a and b in this order is a square number. Constraints * 1 ≤ a,b ≤ 100 * a and b are integers. Input Input is given from Standard Input in the following format: a b Output If the concatenation of a and b in this order is a square number, print `Yes`; otherwise, print `No`. Examples Input 1 21 Output Yes Input 100 100 Output No Input 12 10 Output No
instruction
0
19,218
5
38,436
"Correct Solution: ``` ab = int(input().replace(' ', '')) n = int(ab**0.5) print('Yes' if n*n == ab else 'No') ```
output
1
19,218
5
38,437
Provide a correct Python 3 solution for this coding contest problem. AtCoDeer the deer has found two positive integers, a and b. Determine whether the concatenation of a and b in this order is a square number. Constraints * 1 ≤ a,b ≤ 100 * a and b are integers. Input Input is given from Standard Input in the following format: a b Output If the concatenation of a and b in this order is a square number, print `Yes`; otherwise, print `No`. Examples Input 1 21 Output Yes Input 100 100 Output No Input 12 10 Output No
instruction
0
19,219
5
38,438
"Correct Solution: ``` a = int(''.join(input().split())) print('Yes' if a**0.5%1 == 0 else 'No') ```
output
1
19,219
5
38,439
Provide a correct Python 3 solution for this coding contest problem. AtCoDeer the deer has found two positive integers, a and b. Determine whether the concatenation of a and b in this order is a square number. Constraints * 1 ≤ a,b ≤ 100 * a and b are integers. Input Input is given from Standard Input in the following format: a b Output If the concatenation of a and b in this order is a square number, print `Yes`; otherwise, print `No`. Examples Input 1 21 Output Yes Input 100 100 Output No Input 12 10 Output No
instruction
0
19,220
5
38,440
"Correct Solution: ``` w1, w2 = input().split() n = int(w1 + w2) print("Yes" if (n **.5) %1 == 0 else "No") ```
output
1
19,220
5
38,441
Provide a correct Python 3 solution for this coding contest problem. AtCoDeer the deer has found two positive integers, a and b. Determine whether the concatenation of a and b in this order is a square number. Constraints * 1 ≤ a,b ≤ 100 * a and b are integers. Input Input is given from Standard Input in the following format: a b Output If the concatenation of a and b in this order is a square number, print `Yes`; otherwise, print `No`. Examples Input 1 21 Output Yes Input 100 100 Output No Input 12 10 Output No
instruction
0
19,221
5
38,442
"Correct Solution: ``` print('Yes' if int(''.join(input().split())) ** 0.5 % 1 == 0 else 'No') ```
output
1
19,221
5
38,443
Provide a correct Python 3 solution for this coding contest problem. AtCoDeer the deer has found two positive integers, a and b. Determine whether the concatenation of a and b in this order is a square number. Constraints * 1 ≤ a,b ≤ 100 * a and b are integers. Input Input is given from Standard Input in the following format: a b Output If the concatenation of a and b in this order is a square number, print `Yes`; otherwise, print `No`. Examples Input 1 21 Output Yes Input 100 100 Output No Input 12 10 Output No
instruction
0
19,222
5
38,444
"Correct Solution: ``` a,b = input().split() ab = int(a+b) print("Yes" if (ab**0.5).is_integer() else "No") ```
output
1
19,222
5
38,445
Provide a correct Python 3 solution for this coding contest problem. AtCoDeer the deer has found two positive integers, a and b. Determine whether the concatenation of a and b in this order is a square number. Constraints * 1 ≤ a,b ≤ 100 * a and b are integers. Input Input is given from Standard Input in the following format: a b Output If the concatenation of a and b in this order is a square number, print `Yes`; otherwise, print `No`. Examples Input 1 21 Output Yes Input 100 100 Output No Input 12 10 Output No
instruction
0
19,223
5
38,446
"Correct Solution: ``` a = int("".join(input().split())) print("Yes" if a == int(a**0.5)**2 else "No") ```
output
1
19,223
5
38,447
Provide a correct Python 3 solution for this coding contest problem. AtCoDeer the deer has found two positive integers, a and b. Determine whether the concatenation of a and b in this order is a square number. Constraints * 1 ≤ a,b ≤ 100 * a and b are integers. Input Input is given from Standard Input in the following format: a b Output If the concatenation of a and b in this order is a square number, print `Yes`; otherwise, print `No`. Examples Input 1 21 Output Yes Input 100 100 Output No Input 12 10 Output No
instruction
0
19,224
5
38,448
"Correct Solution: ``` ab=int(input().replace(" ","")) print("No" if ab**.5%1 else "Yes") ```
output
1
19,224
5
38,449
Provide a correct Python 3 solution for this coding contest problem. AtCoDeer the deer has found two positive integers, a and b. Determine whether the concatenation of a and b in this order is a square number. Constraints * 1 ≤ a,b ≤ 100 * a and b are integers. Input Input is given from Standard Input in the following format: a b Output If the concatenation of a and b in this order is a square number, print `Yes`; otherwise, print `No`. Examples Input 1 21 Output Yes Input 100 100 Output No Input 12 10 Output No
instruction
0
19,225
5
38,450
"Correct Solution: ``` a=int(input().replace(" ","")) print("Yes" if a==int(a**0.5)**2 else "No") ```
output
1
19,225
5
38,451
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. AtCoDeer the deer has found two positive integers, a and b. Determine whether the concatenation of a and b in this order is a square number. Constraints * 1 ≤ a,b ≤ 100 * a and b are integers. Input Input is given from Standard Input in the following format: a b Output If the concatenation of a and b in this order is a square number, print `Yes`; otherwise, print `No`. Examples Input 1 21 Output Yes Input 100 100 Output No Input 12 10 Output No Submitted Solution: ``` N = int(input().replace(" ","")) print("Yes" if (N**0.5).is_integer() else "No") ```
instruction
0
19,226
5
38,452
Yes
output
1
19,226
5
38,453
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. AtCoDeer the deer has found two positive integers, a and b. Determine whether the concatenation of a and b in this order is a square number. Constraints * 1 ≤ a,b ≤ 100 * a and b are integers. Input Input is given from Standard Input in the following format: a b Output If the concatenation of a and b in this order is a square number, print `Yes`; otherwise, print `No`. Examples Input 1 21 Output Yes Input 100 100 Output No Input 12 10 Output No Submitted Solution: ``` ab = int(input().replace(' ', '')) print('Yes' if ab**0.5%1 == 0 else 'No') ```
instruction
0
19,227
5
38,454
Yes
output
1
19,227
5
38,455
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. AtCoDeer the deer has found two positive integers, a and b. Determine whether the concatenation of a and b in this order is a square number. Constraints * 1 ≤ a,b ≤ 100 * a and b are integers. Input Input is given from Standard Input in the following format: a b Output If the concatenation of a and b in this order is a square number, print `Yes`; otherwise, print `No`. Examples Input 1 21 Output Yes Input 100 100 Output No Input 12 10 Output No Submitted Solution: ``` k = int(input().replace(' ', '')) ** (1 / 2) print('Yes' if int(k) == k else 'No') ```
instruction
0
19,228
5
38,456
Yes
output
1
19,228
5
38,457
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. AtCoDeer the deer has found two positive integers, a and b. Determine whether the concatenation of a and b in this order is a square number. Constraints * 1 ≤ a,b ≤ 100 * a and b are integers. Input Input is given from Standard Input in the following format: a b Output If the concatenation of a and b in this order is a square number, print `Yes`; otherwise, print `No`. Examples Input 1 21 Output Yes Input 100 100 Output No Input 12 10 Output No Submitted Solution: ``` a, b = input().split() print('Yes') if (int(a+b)**0.5).is_integer() else print('No') ```
instruction
0
19,229
5
38,458
Yes
output
1
19,229
5
38,459
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. AtCoDeer the deer has found two positive integers, a and b. Determine whether the concatenation of a and b in this order is a square number. Constraints * 1 ≤ a,b ≤ 100 * a and b are integers. Input Input is given from Standard Input in the following format: a b Output If the concatenation of a and b in this order is a square number, print `Yes`; otherwise, print `No`. Examples Input 1 21 Output Yes Input 100 100 Output No Input 12 10 Output No Submitted Solution: ``` import math a, b = input().split() n = int(a+b) if math.abs(math.sqrt(n)**2 - n) < 1e-6: print("Yes") else: print("No") ```
instruction
0
19,230
5
38,460
No
output
1
19,230
5
38,461
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. AtCoDeer the deer has found two positive integers, a and b. Determine whether the concatenation of a and b in this order is a square number. Constraints * 1 ≤ a,b ≤ 100 * a and b are integers. Input Input is given from Standard Input in the following format: a b Output If the concatenation of a and b in this order is a square number, print `Yes`; otherwise, print `No`. Examples Input 1 21 Output Yes Input 100 100 Output No Input 12 10 Output No Submitted Solution: ``` import math l = input().split() # print(l) a = int(l[0]) b = int(l[1]) ln = len(l) num = a*10**ln+b sq = math.sqrt(num) if math.floor(sq)**2 == num: print("Yes") else: print("No") ```
instruction
0
19,231
5
38,462
No
output
1
19,231
5
38,463
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. AtCoDeer the deer has found two positive integers, a and b. Determine whether the concatenation of a and b in this order is a square number. Constraints * 1 ≤ a,b ≤ 100 * a and b are integers. Input Input is given from Standard Input in the following format: a b Output If the concatenation of a and b in this order is a square number, print `Yes`; otherwise, print `No`. Examples Input 1 21 Output Yes Input 100 100 Output No Input 12 10 Output No Submitted Solution: ``` a, b = input().split() c = (int(a+b))**0.5 if c**2 == int(a+b): print('Yes') else: print('No') ```
instruction
0
19,232
5
38,464
No
output
1
19,232
5
38,465
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. AtCoDeer the deer has found two positive integers, a and b. Determine whether the concatenation of a and b in this order is a square number. Constraints * 1 ≤ a,b ≤ 100 * a and b are integers. Input Input is given from Standard Input in the following format: a b Output If the concatenation of a and b in this order is a square number, print `Yes`; otherwise, print `No`. Examples Input 1 21 Output Yes Input 100 100 Output No Input 12 10 Output No Submitted Solution: ``` import math a,b = map(int,input().split()) c = a*10+b if c == (math.sqrt(c))**2: print("Yes") else: print("No") ```
instruction
0
19,233
5
38,466
No
output
1
19,233
5
38,467
Provide a correct Python 3 solution for this coding contest problem. You are given an integer N. For two positive integers A and B, we will define F(A,B) as the larger of the following: the number of digits in the decimal notation of A, and the number of digits in the decimal notation of B. For example, F(3,11) = 2 since 3 has one digit and 11 has two digits. Find the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \times B. Constraints * 1 \leq N \leq 10^{10} * N is an integer. Input The input is given from Standard Input in the following format: N Output Print the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \times B. Examples Input 10000 Output 3 Input 1000003 Output 7 Input 9876543210 Output 6
instruction
0
19,250
5
38,500
"Correct Solution: ``` N = int(input()) A = [] for i in range(int(N**0.5)): if N%(i+1) == 0: A.append(i+1) print(len(str(int(N/A[-1])))) ```
output
1
19,250
5
38,501
Provide a correct Python 3 solution for this coding contest problem. You are given an integer N. For two positive integers A and B, we will define F(A,B) as the larger of the following: the number of digits in the decimal notation of A, and the number of digits in the decimal notation of B. For example, F(3,11) = 2 since 3 has one digit and 11 has two digits. Find the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \times B. Constraints * 1 \leq N \leq 10^{10} * N is an integer. Input The input is given from Standard Input in the following format: N Output Print the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \times B. Examples Input 10000 Output 3 Input 1000003 Output 7 Input 9876543210 Output 6
instruction
0
19,251
5
38,502
"Correct Solution: ``` n = int(input()) y = 0 for i in range(int(n**0.5)+1, 0, -1): if n % i == 0: y = len(str(n//i)) break print(y) ```
output
1
19,251
5
38,503
Provide a correct Python 3 solution for this coding contest problem. You are given an integer N. For two positive integers A and B, we will define F(A,B) as the larger of the following: the number of digits in the decimal notation of A, and the number of digits in the decimal notation of B. For example, F(3,11) = 2 since 3 has one digit and 11 has two digits. Find the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \times B. Constraints * 1 \leq N \leq 10^{10} * N is an integer. Input The input is given from Standard Input in the following format: N Output Print the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \times B. Examples Input 10000 Output 3 Input 1000003 Output 7 Input 9876543210 Output 6
instruction
0
19,252
5
38,504
"Correct Solution: ``` n,r=int(input()),1e9 print(min([len(str(n//i)) for i in range(1,int(n**.5)+1) if n%i==0])) ```
output
1
19,252
5
38,505
Provide a correct Python 3 solution for this coding contest problem. You are given an integer N. For two positive integers A and B, we will define F(A,B) as the larger of the following: the number of digits in the decimal notation of A, and the number of digits in the decimal notation of B. For example, F(3,11) = 2 since 3 has one digit and 11 has two digits. Find the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \times B. Constraints * 1 \leq N \leq 10^{10} * N is an integer. Input The input is given from Standard Input in the following format: N Output Print the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \times B. Examples Input 10000 Output 3 Input 1000003 Output 7 Input 9876543210 Output 6
instruction
0
19,253
5
38,506
"Correct Solution: ``` n=int(input()) for i in range(int(n**0.5),0,-1): if n%i==0: break print(len(str(n//i))) ```
output
1
19,253
5
38,507
Provide a correct Python 3 solution for this coding contest problem. You are given an integer N. For two positive integers A and B, we will define F(A,B) as the larger of the following: the number of digits in the decimal notation of A, and the number of digits in the decimal notation of B. For example, F(3,11) = 2 since 3 has one digit and 11 has two digits. Find the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \times B. Constraints * 1 \leq N \leq 10^{10} * N is an integer. Input The input is given from Standard Input in the following format: N Output Print the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \times B. Examples Input 10000 Output 3 Input 1000003 Output 7 Input 9876543210 Output 6
instruction
0
19,254
5
38,508
"Correct Solution: ``` n = int(input()) mx = 1 for i in range(2,int(n**(1/2))+1): if n%i == 0: mx = i print(len(str(n//mx))) ```
output
1
19,254
5
38,509
Provide a correct Python 3 solution for this coding contest problem. You are given an integer N. For two positive integers A and B, we will define F(A,B) as the larger of the following: the number of digits in the decimal notation of A, and the number of digits in the decimal notation of B. For example, F(3,11) = 2 since 3 has one digit and 11 has two digits. Find the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \times B. Constraints * 1 \leq N \leq 10^{10} * N is an integer. Input The input is given from Standard Input in the following format: N Output Print the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \times B. Examples Input 10000 Output 3 Input 1000003 Output 7 Input 9876543210 Output 6
instruction
0
19,255
5
38,510
"Correct Solution: ``` N = int(input()) for i in range(int(N ** 0.5), 0, -1): if N % i == 0: break j = N // i print(len(str(j))) ```
output
1
19,255
5
38,511
Provide a correct Python 3 solution for this coding contest problem. You are given an integer N. For two positive integers A and B, we will define F(A,B) as the larger of the following: the number of digits in the decimal notation of A, and the number of digits in the decimal notation of B. For example, F(3,11) = 2 since 3 has one digit and 11 has two digits. Find the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \times B. Constraints * 1 \leq N \leq 10^{10} * N is an integer. Input The input is given from Standard Input in the following format: N Output Print the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \times B. Examples Input 10000 Output 3 Input 1000003 Output 7 Input 9876543210 Output 6
instruction
0
19,256
5
38,512
"Correct Solution: ``` n=int(input()) l=int((n**0.5))+1 ans=n for i in range(1, l+1): if n%i==0: ans=min(ans, len(str(n//i))) print(ans) ```
output
1
19,256
5
38,513
Provide a correct Python 3 solution for this coding contest problem. You are given an integer N. For two positive integers A and B, we will define F(A,B) as the larger of the following: the number of digits in the decimal notation of A, and the number of digits in the decimal notation of B. For example, F(3,11) = 2 since 3 has one digit and 11 has two digits. Find the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \times B. Constraints * 1 \leq N \leq 10^{10} * N is an integer. Input The input is given from Standard Input in the following format: N Output Print the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \times B. Examples Input 10000 Output 3 Input 1000003 Output 7 Input 9876543210 Output 6
instruction
0
19,257
5
38,514
"Correct Solution: ``` n=int(input()) for i in range(int(0-n**.5//-1),1,-1): if n%i==0: print(len(str(n//i))) exit() print(len(str(n))) ```
output
1
19,257
5
38,515
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given an integer N. For two positive integers A and B, we will define F(A,B) as the larger of the following: the number of digits in the decimal notation of A, and the number of digits in the decimal notation of B. For example, F(3,11) = 2 since 3 has one digit and 11 has two digits. Find the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \times B. Constraints * 1 \leq N \leq 10^{10} * N is an integer. Input The input is given from Standard Input in the following format: N Output Print the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \times B. Examples Input 10000 Output 3 Input 1000003 Output 7 Input 9876543210 Output 6 Submitted Solution: ``` import math n=int(input()) s=1 for i in range(int(math.sqrt(n))+1): if n%(i+1)==0: s=len(str(int(n/(i+1)))) print(s) ```
instruction
0
19,258
5
38,516
Yes
output
1
19,258
5
38,517