Problem:


Score : 100 points

Problem Statement

Takahashi is meeting up with Aoki.

They have planned to meet at a place that is D meters away from Takahashi's house in T minutes from now.

Takahashi will leave his house now and go straight to the place at a speed of S meters per minute.

Will he arrive in time?

Constraints

1 \leq D \leq 10000

1 \leq T \leq 10000

1 \leq S \leq 10000

All values in input are integers.

Input

Input is given from Standard Input in the following format:

D T S

Output

If Takahashi will reach the place in time, print Yes; otherwise, print No.

Sample Input 1

1000 15 80

Sample Output 1

Yes

It takes 12.5 minutes to go 1000 meters to the place at a speed of 80 meters per minute. They have planned to meet in 15 minutes so he will arrive in time.

Sample Input 2

2000 20 100

Sample Output 2

Yes

It takes 20 minutes to go 2000 meters to the place at a speed of 100 meters per minute. They have planned to meet in 20 minutes so he will arrive just on time.

Sample Input 3

10000 1 1

Sample Output 3

No

He will be late.



Sample input:
1000 15 80


Sample output:
Yes

Submission status: Runtime Error

Solution code:
import numpy as np
A = np.asarray(input().split()).astype(np.int)
 
ans = 0
mod = 10**9 + 7
for i in range(N):
    pA = (A[i] % mod) * (A[i+1:].sum() % mod)
    ans += pA
 
print(int(ans % mod))

Submission status: Runtime Error

Solution code:
d=int(input())
t=int(input())
s=int(input())
sp=d/t
if(s>=sp):
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
n = int(input())
m = 1e9 + 7
a = list(map(int, input().split()))
s = sum(a)
s *= s
r = sum([x*x for x in a])
ans = (s - r) // 2
ans %= m
print(ans)

Submission status: Runtime Error

Solution code:
a, b, c = int(input().split())
i = a/c
if i <=b:
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
D,T,S= [int(x) for x in input("Enter values in the range of 1 and 10000: ").split(",")] 
if (D and T) and S <=10000 and D/S<=T:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
d=int(input())
t=int(input())
s=int(input())
speed=d/t
if(s>=speed):
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
S = input()
T = input()
ruijimax = 0

for first in range(len(S)-len(T)):
    ruiji = 0
    for i in range(len(T)):
        if S[first+i] == T[i]:
            ruiji += 1
    if ruijimax <= ruiji:
        ruijimax = ruiji

print(len(T)-ruijimax)

Submission status: Runtime Error

Solution code:
import math
import collections
import fractions
import itertools
import functools
import operator
import bisect

def solve():
    n, m = map(int, input().split())
    group = []
    done = [-1]*n
    num = 0
    for i in range(m):
        a, b = map(lambda x:int(x)-1, input().split())
        if done[a] != -1:
            if done[b] == -1:
                group[done[a]].append(b)
                done[b] = done[a]
        else:
            if done[b] == -1:
                group.append([a,b])
                done[a], done[b] = num, num
                num += 1
            else:
                group[done[b]].append(a)
                done[a] = done[b]
    people = [0]+[len(i) for i in group]
    print(max(people))
    return 0

if __name__ == "__main__":
    solve()

Submission status: Runtime Error

Solution code:
import math
import collections
import fractions
import itertools
import functools
import operator
import bisect

def solve():
    s = input()
    t = input()
    hoge = 10000
    let = len(t)
    les = len(s)
    ans = 10000
    for i in range(les-let+1):
        hoge = s[i:i+let]
        piyo = 0
        for j, k in zip(hoge,t):
            if j != k:
                piyo += 1
        if piyo < ans:
            ans = piyo
    print(ans)
    return 0

if __name__ == "__main__":
    solve()

Submission status: Runtime Error

Solution code:
s = input()
t = input()
count=10000000000
COUNT=0
for j in range(len(s)-len(t)-1):
    for i in range(len(t)):
        if not t[i]==s[j]:
            COUNT+=1
    count=min(count,COUNT)
print(count)

Submission status: Runtime Error

Solution code:
N= int(input())
list1 =[]
list1 = list(map(int, input().split()))
sum = 0

print(list1)  
for i in range(N-1):
    for j in range(i+1,N):
        
        sum = sum + list1[i]*list1[j]
answer = divmod(sum, 10**9+7)
print(answer[1])

Submission status: Runtime Error

Solution code:
import itertools
n = int(input())
alist = list(map(int, input().split()))
result = 0
amari = 0
nmod = 10 ** 9 + 7
    
for i in itertools.combinations(alist, 2):
  amari = ((i[0] % nmod) * (i[1] % nmod)) % nmod
  result = (result + amari) % nmod
  
print(result)

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int,input().split()))
sum = 0
for i in range(n):
    sum += a[i]
sum = sum*sum
for j in range(n):
    sum = sum - a[j]*a[j]
sum = sum
print((sum%1000000007)/2)

Submission status: Runtime Error

Solution code:
N, M  = map(int, input().split())
S = []
for i in range(M):
    S.append(set(input().split()))

groups = [S[0]]

for j in range(1,len(S)-1):
    for k in range(len(groups)):
        if S[j] & groups[k] != set():
            groups[k] = S[j] | group
        else:
            groups.append(S[j])
lens = []
for group in groups:
    lens.append(len(group))
print(max(lens))

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split())
li=[]
ans=0
if m!=0: 
    for i in range(m):
        a,b=map(int,input().split())
        if len(li)==0:
            li.append([a,b])
        else:
            flag=0
            for j in range(len(li)):
                if a in li[j] and b not in li[j]:
                	li[j].append(b)
                	flag=1
                elif a not in li[j] and b in li[j]:
                    li[j].append(a)
                    flag=1
                elif a in li[j] and b in li[j]:
                    break
                elif flag==0 and j==len(li)-1:
                    li.append([a,b])
        #print(li)
    ans=max([len(li[i]) for i in range(len(li))])
print(ans if m!=0 else 1)

Submission status: Runtime Error

Solution code:
n, m = list(map(int, input().split()))
am = []
bm = []
for _ in range(m):
    a, b = list(map(int, input().split()))
    am.append(a)
    bm.append(b)

groups = []
for ai, bi in zip(am, bm):
    ag = None
    bg = None
    for g, group in enumerate(groups):
        if ai in group:
            ag = g
        if bi in group:
            bg = g
    if ag is None:
        if bg is None:
            groups.append([ai, bi])
        else:
            groups[bg].append(ai)
    else:
        if bg is None:
            groups[ag].append(bi)
        else:
            if ag != bg:
                groups[ag].extend(groups[bg])
                del groups[bg]

# max_gr_len = 1
# for group in groups:
#     if max_gr_len < len(group):
#         max_gr_len = len(group)
max_gr_len = max([len(group) for group in groups] + [1])

print(max_gr_len)

Submission status: Runtime Error

Solution code:
d, t, s = input()
if d / t > s:
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
D,T,S = input().split()
print("Yes" if D / S < T else "No")

Submission status: Runtime Error

Solution code:
def dfs(g, start):
    visited[start] = True
    cc.append(0)
    for nbr in g[start]:
        if not visited[nbr]:
            dfs(g, nbr)



from collections import defaultdict
n, m = map(int, input().split())
g = defaultdict(set)

for _ in range(m):
    a, b = map(int, input().split())
    g[a - 1].add(b - 1)
    g[b - 1].add(a - 1)


visited = [False]*n
ans = 0
for i in range(n):
    if not visited[i]:
        cc = []
        dfs(g, i)
        ans = max(ans, len(cc))

print(ans)

Submission status: Runtime Error

Solution code:
from sys import stdin
import itertools
def main():
    number = int(input())
    num_list = list(map(int, stdin.readline().split()))
    comb = list(itertools.combinations(num_list, 2))
    total = sum([c1*c2 for c1, c2 in comb])
    print(total % (1000000000 + 7))
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
def dfs(g, start):
    visited[start] = True
    cc.append(0)
    for nbr in g[start]:
        if not visited[nbr]:
            dfs(g, nbr)



import sys
from collections import defaultdict
input = sys.stdin.readline
n, m = map(int, input().split())
g = defaultdict(set)

for _ in range(m):
    a, b = map(int, input().split())
    g[a - 1].add(b - 1)
    g[b - 1].add(a - 1)


visited = [False]*n
ans = 0
for i in range(n):
    if not visited[i]:
        cc = []
        dfs(g, i)
        ans = max(ans, len(cc))

print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int,input().split()))


Sum = 0
mod_n = 10.0E8 +7

for i in range(N-1):
    for j in range(i+1,N):
        if j == len(A):
            break
        else:
            Sum +=  A[i]*A[j]
        


# for i in A:
#     Sum -= i**2

# Sum = int(Sum/2)
print(Sum)


print(int(Sum % mod_n))

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))
sum_ = 0
for i in range(N):
    for j in range(i, N):
        sum_ += A[i] * A[j]
        sum_ %= 1_000_000_007

print(sum_)

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))

sum=0
for i in range(n-1) :
  for j in range(n-i-1) :
    sum += a[i]*a[j+i+1]
    sum = sum%1000000007

print(sum)

Submission status: Runtime Error

Solution code:
d,t,s=list(map(int,input().split()))
if d//s<=t:
    print("Yes")
elif d=0 or t=0 or s=0:
    print("Yes")

    
else:
    print("No")

Submission status: Runtime Error

Solution code:
for i in range(len(S)-len(T)+1):
	sub_S = S[i:i+len(T)]
	cnt = 0
	for j in range(len(T)):
		if sub_S[j] != T[j]:
			cnt += 1
	cnt_list.append(cnt)
print(min(cnt_list))

Submission status: Runtime Error

Solution code:
def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    x = []
    for i in range(1, N):
        x.append(sum(A[i:]))

    ans = 0
    for i in range(N-1):
        ans += A[i] * x[i]
    ans = ans % (10**9 + 7)
    print(ans)

if __name__ == "__main__":
    resolve()

Submission status: Runtime Error

Solution code:
import sys,bisect

from sys  import stdin,stdout

from bisect import bisect_left,bisect_right,bisect,insort,insort_left,insort_right

from math import gcd,ceil,floor,sqrt

from collections import Counter,defaultdict,deque,OrderedDict

dx=[-1,1,0,0]
dy=[0,0,1,-1]


sys.setrecursionlimit(10**6)
INF = float('inf')
MOD = 998244353
mod = 10**9+7

def isPrime(n):
    if (n <= 1) :return False
    if (n <= 3) :return True
    if (n%2 == 0 or n%3 == 0):return False
    for i in range(5,ceil(sqrt(n))+1,6):
        if (n%i==0 or n%(i+2)==0):
            return False
    return True

def st():
    return list(stdin.readline().strip())

def inp():
    return int(stdin.readline())

def li():
    return list(map(int,stdin.readline().split()))

def mp():
    return map(int,stdin.readline().split())

def pr(n):
    stdout.write(str(n)+"\n")

def CC(d,v,i,l):
    v[i]=True
    stack=[i]
    c=1
    while stack:
        a=stack.pop()
        for i in d[a]:
            if not v[i]:
                stack.append(i)
                v[i]=True
                c+=1
    l.append(c)
    
def solve():
    n,m=mp()
    d={i:[] for i in range(1,n+1)}
    for i in range(m):
        a,b=mp()
        d[a].append(b)
        d[b].append(a)

    v=[False for i in range(n+1)]
    x=[]
    for i in range(1,n+1):
        if not v[i]:
            CC(d,v,i,x)


   
    cd=0
    p=sum(x)
    while p!=0:
        for i in range(len(x)):
            if x[i]>0:
                x[i]-=1
                p-=1
        cd+=1
    pr(cd)
        
        
    
for _ in range(1):
    solve()

Submission status: Runtime Error

Solution code:
dts = input('')
d,t,s = dts.split(' ')

if d <= t * s:
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

Solution code:
i = input().split()
 
d = i[0]
t = i[1]
s = i[2]

dt = i[0] / i[2]
lt = i[1]

if dt <= lt:
  	print('Yes')
  else:
    print('No')

Submission status: Runtime Error

Solution code:
n=int(input())
l=list(map(int,input().split()))
ans=0
for i in range(n-1):
  ans+=(l[i]*(sum(l[i+1:len(l)+1]))%(10**9+7))
print(ans%(10**9+7))

Submission status: Runtime Error

Solution code:
import numpy as np
n=int(input())
a= list(map(int, input().strip().split()))
a.sort()
b=1
for i in range(n):
    b*=a[i]
f=0#pairwise coprime
for i in range(n):
    if b%(a[i])**2==0:
        f=1
        break
b=np.gcd(a[0],a[1])
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
if f==0:
    print("pairwise coprime")

Submission status: Runtime Error

Solution code:
l=[]
for i in range(3):
  l.append(int(input()))
d=l[0]
t=l[1]
s=l[2]

time=d/s
if(time<=t):
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
i = list(map(int, input().split()))
print("Yes" if i[0]>i[1]*1[2] else "No")

Submission status: Runtime Error

Solution code:
a = [input().split() for l in range(2)]
count = 0
N = int(a[0][0])
 
for i in range(N):
    for j in range(i):
        if i != j:
            count = (int(a[1][i])*int(a[1][j])) % 1000000007 + count
count = count % 1000000007
print(count)

Submission status: Runtime Error

Solution code:
import itertools

def NextInts(): return map(int,input().split())

saisyo = input()
X = NextInts()
p = itertools.combinations(X, 2)
ANSWER = 0
for i in p:
	answer = int(i[0])*int(i[1])
	ANSWER+=answer
print(ANSWER%(10**9+7))

Submission status: Runtime Error

Solution code:
a = int(input())
p = list(map(int,input().split()))
mod = 10**9 + 7

sum_list =[p[i]*p[t] for i in range(a) for t in range(a) if i<=t and not i ==t]
num = sum(sum_list)%mod
print(num)

Submission status: Runtime Error

Solution code:
d = int(input())
t = int(input())
s = int(input())

if d/s >= t:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
 D,T,S = map(int,input().split())
 if T*S >= D:
   print("Yes")
 else:
   print("No")

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
result = 0
d = 0
for i in range(n):
  d += a[i] ** 2
result = int(((sum(a) % (10**9 + 7)) ** 2 - d) / 2)
result = result % (10**9 + 7)
print(result)

Submission status: Runtime Error

Solution code:
 A,B,C = map(int,input().split())
 if B*C >= A:
   print("Yes")
 else:
   print("No")

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))

number = 0
MOD = 1000000007

for i in range(N-1):
    for j in range(i+1, N):
        number += A[i]*A[j]


if number > MOD:
    print(number%MOD)
else:
    print(number)

Submission status: Runtime Error

Solution code:
import itertools
s = input()
t = input()

ans = 0

A = itertools.combinations(list(range(len(t)+1)),2)
for i in A:
    part = t[i[0]:i[1]]
    if part in s:
        ans = len(part)
        
print(len(t) - ans)

Submission status: Runtime Error

Solution code:
D, T, S =input().split(' ')
i = int(D/S)
if i > T:
  answer = "No"
else:
  answer = "Yes"
print answer

Submission status: Runtime Error

Solution code:
import java.util.*;
import java.io.*;
import java.math.BigInteger;
public class Main {
    static long mod = (long)1e9 + 7;
    static long mod1 = 998244353;
    static FastScanner f;
    static PrintWriter pw = new PrintWriter(System.out);
    static Scanner S = new Scanner(System.in);
    static long x0; static long y0;
    static int inf = (int)(1e9) + 5;
    static long iinf = (long)(1e18);
    static double eps = (double)1e-4;
    static void solve()throws IOException {
        double d = f.nd(); double t = f.nd(); double s = f.nd();
        double t1 = d / s;
        pn(t1 <= t ? "Yes" : "No");
        pn(sum);
    }   
    public static void main(String[] args)throws NumberFormatException , IOException {
        init();
        boolean tc = false;
        int t = tc ? f.ni() : 1;
        while(t --> 0) solve();
        pw.flush(); 
        pw.close();  
    }
        
/******************************END OF MAIN PROGRAM*******************************************/
    public static void init()throws IOException{if(System.getProperty("ONLINE_JUDGE")==null){f=new FastScanner("");}else{f=new FastScanner(System.in);}}
    public static class FastScanner {
        BufferedReader br;StringTokenizer st;
        FastScanner(InputStream stream){try{br=new BufferedReader(new InputStreamReader(stream));}catch(Exception e){e.printStackTrace();}}
        FastScanner(String str){try{br=new BufferedReader(new FileReader("!a.txt"));}catch(Exception e){e.printStackTrace();}}
        String next(){while(st==null||!st.hasMoreTokens()){try{st=new StringTokenizer(br.readLine());}catch(IOException e){e.printStackTrace();}}return st.nextToken();}
        String nextLine()throws IOException{return br.readLine();}int ni(){return Integer.parseInt(next());}long nl(){return Long.parseLong(next());}double nd(){return Double.parseDouble(next());}
    }
    public static void pn(Object o){pw.println(o);}
    public static void p(Object o){pw.print(o);}
    public static void pni(Object o){pw.println(o);pw.flush();}
    static int gcd(int a,int b){if(b==0)return a;else{return gcd(b,a%b);}}
    static long gcd(long a,long b){if(b==0l)return a;else{return gcd(b,a%b);}}
    static long lcm(long a,long b){return (a*b/gcd(a,b));}
    static long exgcd(long a,long b){if(b==0){x0=1;y0=0;return a;}long temp=exgcd(b,a%b);long t=x0;x0=y0;y0=t-a/b*y0;return temp;}
    static long pow(long a,long b){long res=1;while(b>0){if((b&1)==1)res=res*a;b>>=1;a=a*a;}return res;}
    static long mpow(long a,long b){long res=1;while(b>0l){if((b&1)==1l)res=((res%mod)*(a%mod))%mod;b>>=1l;a=((a%mod)*(a%mod))%mod;}return res;}
    static long mul(long a , long b){return ((a%mod)*(b%mod)%mod);}
    static long adp(long a , long b){return ((a%mod)+(b%mod)%mod);}
    static int log2(int x){return (int)(Math.log(x)/Math.log(2));}
    static boolean isPrime(long n){if(n<=1)return false;if(n<=3)return true;if(n%2==0||n%3==0)return false;for(long i=5;i*i<=n;i=i+6)if(n%i==0||n%(i+2)==0)return false;return true;}
    static boolean isPrime(int n){if(n<=1)return false;if(n<=3)return true;if(n%2==0||n%3==0)return false;for(int i=5;i*i<=n;i=i+6)if(n%i==0||n%(i+2)==0)return false;return true;}
    static HashSet<Long> factors(long n){HashSet<Long> hs=new HashSet<Long>();for(long i=1;i<=(long)Math.sqrt(n);i++){if(n%i==0){hs.add(i);hs.add(n/i);}}return hs;}
    static HashSet<Integer> factors(int n){HashSet<Integer> hs=new HashSet<Integer>();for(int i=1;i<=(int)Math.sqrt(n);i++){if(n%i==0){hs.add(i);hs.add(n/i);}}return hs;}
    static HashSet<Long> pf(long n){HashSet<Long> ff=factors(n);HashSet<Long> res=new HashSet<Long>();for(Long i:ff)if(isPrime(i))res.add(i);return res;}
    static HashSet<Integer> pf(int n){HashSet<Integer> ff=factors(n);HashSet<Integer> res=new HashSet<Integer>();for(Integer i:ff)if(isPrime(i))res.add(i);return res;}
    static int[] inpint(int n){int arr[]=new int[n+1];for(int i=1;i<=n;++i){arr[i]=f.ni();}return arr;}
    static long[] inplong(int n){long arr[] = new long[n+1];for(int i=1;i<=n;++i){arr[i]=f.nl();}return arr;}
    static boolean ise(int x){return ((x&1)==0);}static boolean ise(long x){return ((x&1)==0);}
    static int gnv(char c){return Character.getNumericValue(c);}//No. of integers less than equal to i in ub
    static int log(long x){return x==1?0:(1+log(x/2));} static int log(int x){return x==1?0:(1+log(x/2));}
    static int upperbound(int a[],int i){int lo=0,hi=a.length-1,mid=0;int count=0;while(lo<=hi){mid=(lo+hi)/2;if(a[mid]<=i){count=mid+1;lo=mid+1;}else hi=mid-1;}return count;}
    static void sort(int[] a){ArrayList<Integer> l=new ArrayList<>();for(int i:a)l.add(i);Collections.sort(l);for(int i=0;i<a.length;++i)a[i]=l.get(i);}
    static void sort(long[] a){ArrayList<Long> l=new ArrayList<>();for(long i:a)l.add(i);Collections.sort(l);for(int i=0;i<a.length;++i)a[i]=l.get(i);}
    static void sort(ArrayList<Integer> a){Collections.sort(a);}//!Precompute fact in ncr()!
    static int nextPowerOf2(int n){int count=0;if(n>0&&(n&(n-1))==0)return n;while(n!=0){n>>=1;count += 1;}return 1<<count;} 
}

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))
result = 0
i = 0
for x in A[:N]:
  for y in A[i+1:]:
    result += x * y
  i += 1

print(result.__mod__(10**9 + 7))

Submission status: Runtime Error

Solution code:
import java.util.*;
import java.io.*;
import java.math.BigInteger;
public class cf1 {
    static long mod = (long)1e9 + 7;
    static long mod1 = 998244353;
    static FastScanner f;
    static PrintWriter pw = new PrintWriter(System.out);
    static Scanner S = new Scanner(System.in);
    static long x0; static long y0;
    static int inf = (int)(1e9) + 5;
    static long iinf = (long)(1e18);
    static double eps = (double)1e-4;
    static void solve()throws IOException {
        double d = f.nd(); double t = f.nd(); double s = f.nd();
        double t1 = d / s;
        pn(t1 <= t ? "Yes" : "No");
    }   
    public static void main(String[] args)throws NumberFormatException , IOException {
        init();
        boolean tc = false;
        int t = tc ? f.ni() : 1;
        while(t --> 0) solve();
        pw.flush(); 
        pw.close();  
    }
        
/******************************END OF MAIN PROGRAM*******************************************/
    public static void init()throws IOException{if(System.getProperty("ONLINE_JUDGE")==null){f=new FastScanner("");}else{f=new FastScanner(System.in);}}
    public static class FastScanner {
        BufferedReader br;StringTokenizer st;
        FastScanner(InputStream stream){try{br=new BufferedReader(new InputStreamReader(stream));}catch(Exception e){e.printStackTrace();}}
        FastScanner(String str){try{br=new BufferedReader(new FileReader("!a.txt"));}catch(Exception e){e.printStackTrace();}}
        String next(){while(st==null||!st.hasMoreTokens()){try{st=new StringTokenizer(br.readLine());}catch(IOException e){e.printStackTrace();}}return st.nextToken();}
        String nextLine()throws IOException{return br.readLine();}int ni(){return Integer.parseInt(next());}long nl(){return Long.parseLong(next());}double nd(){return Double.parseDouble(next());}
    }
    public static void pn(Object o){pw.println(o);}
    public static void p(Object o){pw.print(o);}
    public static void pni(Object o){pw.println(o);pw.flush();}
    static int gcd(int a,int b){if(b==0)return a;else{return gcd(b,a%b);}}
    static long gcd(long a,long b){if(b==0l)return a;else{return gcd(b,a%b);}}
    static long lcm(long a,long b){return (a*b/gcd(a,b));}
    static long exgcd(long a,long b){if(b==0){x0=1;y0=0;return a;}long temp=exgcd(b,a%b);long t=x0;x0=y0;y0=t-a/b*y0;return temp;}
    static long pow(long a,long b){long res=1;while(b>0){if((b&1)==1)res=res*a;b>>=1;a=a*a;}return res;}
    static long mpow(long a,long b){long res=1;while(b>0l){if((b&1)==1l)res=((res%mod)*(a%mod))%mod;b>>=1l;a=((a%mod)*(a%mod))%mod;}return res;}
    static long mul(long a , long b){return ((a%mod)*(b%mod)%mod);}
    static long adp(long a , long b){return ((a%mod)+(b%mod)%mod);}
    static int log2(int x){return (int)(Math.log(x)/Math.log(2));}
    static boolean isPrime(long n){if(n<=1)return false;if(n<=3)return true;if(n%2==0||n%3==0)return false;for(long i=5;i*i<=n;i=i+6)if(n%i==0||n%(i+2)==0)return false;return true;}
    static boolean isPrime(int n){if(n<=1)return false;if(n<=3)return true;if(n%2==0||n%3==0)return false;for(int i=5;i*i<=n;i=i+6)if(n%i==0||n%(i+2)==0)return false;return true;}
    static HashSet<Long> factors(long n){HashSet<Long> hs=new HashSet<Long>();for(long i=1;i<=(long)Math.sqrt(n);i++){if(n%i==0){hs.add(i);hs.add(n/i);}}return hs;}
    static HashSet<Integer> factors(int n){HashSet<Integer> hs=new HashSet<Integer>();for(int i=1;i<=(int)Math.sqrt(n);i++){if(n%i==0){hs.add(i);hs.add(n/i);}}return hs;}
    static HashSet<Long> pf(long n){HashSet<Long> ff=factors(n);HashSet<Long> res=new HashSet<Long>();for(Long i:ff)if(isPrime(i))res.add(i);return res;}
    static HashSet<Integer> pf(int n){HashSet<Integer> ff=factors(n);HashSet<Integer> res=new HashSet<Integer>();for(Integer i:ff)if(isPrime(i))res.add(i);return res;}
    static int[] inpint(int n){int arr[]=new int[n+1];for(int i=1;i<=n;++i){arr[i]=f.ni();}return arr;}
    static long[] inplong(int n){long arr[] = new long[n+1];for(int i=1;i<=n;++i){arr[i]=f.nl();}return arr;}
    static boolean ise(int x){return ((x&1)==0);}static boolean ise(long x){return ((x&1)==0);}
    static int gnv(char c){return Character.getNumericValue(c);}//No. of integers less than equal to i in ub
    static int log(long x){return x==1?0:(1+log(x/2));} static int log(int x){return x==1?0:(1+log(x/2));}
    static int upperbound(int a[],int i){int lo=0,hi=a.length-1,mid=0;int count=0;while(lo<=hi){mid=(lo+hi)/2;if(a[mid]<=i){count=mid+1;lo=mid+1;}else hi=mid-1;}return count;}
    static void sort(int[] a){ArrayList<Integer> l=new ArrayList<>();for(int i:a)l.add(i);Collections.sort(l);for(int i=0;i<a.length;++i)a[i]=l.get(i);}
    static void sort(long[] a){ArrayList<Long> l=new ArrayList<>();for(long i:a)l.add(i);Collections.sort(l);for(int i=0;i<a.length;++i)a[i]=l.get(i);}
    static void sort(ArrayList<Integer> a){Collections.sort(a);}//!Precompute fact in ncr()!
    static int nextPowerOf2(int n){int count=0;if(n>0&&(n&(n-1))==0)return n;while(n!=0){n>>=1;count += 1;}return 1<<count;} 
}

Submission status: Runtime Error

Solution code:
N = int(input())
n = 10 ** 9 + 7
A_n = [int(i) % n for i in input().split()]
A_n_mod = sum([(A_n[i] * A_n[j]) % n for i in range(N-1) for j in range(i+1, N, 1)])
res = A_n_mod % n
print(res)

Submission status: Runtime Error

Solution code:
S = input()
T = input()

min = len(T)
for t in range(len(S) - len(T)+1):
    tmp = 0
    for i in range(len(T)):
        if S[i+t] != T[i]:
            tmp+=1
    
    if tmp < min:
        min = tmp

print(min)

Submission status: Runtime Error

Solution code:
def multmod(a,b,m):
  ans = 0
  a = a % m
  
  while b:
    if (b & 1): # odd
      ans = (ans + a) % m
    
    a = (2 * a) % m
    b >>= 1 # b = b / 2
    
  return ans

n = int(input())
S = [int(a) for a in input().split()]
divisor = 10**9 + 7
tot = 0
a,b = 0,0
arr_sum = sum(S) #% divisor
arr_ssq = arr_sum*arr_sum % divisor
isq_sum = 0
for i in range(n):
  isq_sum += S[i]*S[i] #% divisor
  
#isq_sum = isq_sum % divisor
tot = (arr_ssq - isq_sum)//2 % divisor

print(tot)

Submission status: Runtime Error

Solution code:
d,t,s=intput().split()
d=int(d)
t=int(t)
s=int(s)
d1=s*t
if d<=d1:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
D = int(input())
T = int(input())
S = int(input())

if(D/S<=T):
  print('Yes')
  
else:
  print('No')

Submission status: Runtime Error

Solution code:
d,t,s=intput().split()
d=int(d)
t=int(t)
s=int(s)
d1=s*t
if d<=d1:
  print("Yes")
else:
  print("No)

Submission status: Runtime Error

Solution code:
def abc177d():
    n, m = map(int, input().split())
    check = [-1] * n
    pair = []
    group_no = 0
    group = {}
    for i in range(m):
        a, b = map(int, input().split())
        a -= 1
        b -= 1
        if check[a] == check[b]:
            if check[a] == -1:
                group[group_no] = {a, b}
                check[a] = check[b] = group_no
                group_no += 1
        elif check[a] == -1:
            group[check[b]].add(a)
            check[a] = check[b]
        elif check[b] == -1:
            group[check[a]].add(b)
            check[b] = check[a]
        else:
            re = min(check[a], check[b])
            de = max(check[a], check[b])
            for v in group[de]:
                check[v] = re
            group[re] = group[re] | group[de]
            del group[de]
    max_val = 1
    for k in group:
        max_val = max(max_val,len(group[k]))
    print(max_val)
abc177d()

Submission status: Runtime Error

Solution code:
def main():
    N=input()
    A=list(map(int, input().split()))

    mod_value = 10**9 + 7
    sum_ = 0
    b_sum = 0
    for i in range(len(A)-1):
        b_sum = b_sum + A[len(A)-i-1]
        sum_ = sum_ + (A[len(A)- i - 2]*b_sum) % mod_value
    print(sum_%mod_value)
main()

Submission status: Runtime Error

Solution code:
# union find, bfs

import sys
from collections import deque
si = sys.stdin.readline


def main():
    [n, m] = [int(e) for e in si().split()]
    if not m:
        print(1)
        return

    visited = [False]*(n+1)
    fm = [set() for _ in range(n+1)]
    mx, comp = 0, 0

    while m:
        m -= 1
        [a, b] = [int(e) for e in si().split()]
        fm[a].add(b)
        fm[b].add(a)

    for i in range(1, n+1):
        if visited[i]:
            continue
        visited[i] = True
        comp += 1
        q = deque()
        q.append(i)
        cnt = 1
        while q:
            curr = q.popleft()
            for e in fm[curr]:
                if not visited[e]:
                    visited[e] = True
                    q.append(e)
                    cnt += 1
        mx = max(mx, cnt)
    print(mx)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
result = 0
for i in range(n):
  for j in range(i + 1, n):
    result += a[i] * a[j]
result = result % (10**9 + 7)
print(result)

Submission status: Runtime Error

Solution code:
from collections import defaultdict
def generate_primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]

def main():  
    n = int(input())
    A = list(map(int, input().split()))
    d = defaultdict(int)
    primes = generate_primes(max(A))
    for a in A:
        for p in primes:
            if a < p: break
            if a % p == 0:
                d[p] += 1
    d[1] = 0
    m = max(d.values())
    if m == n:
        print('not coprime')
    elif m >= 2:
        print('setwise coprime')
    else:
        print('pairwise coprime')
    

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
d,t,s=intput().split()
d1=s*t
if d<=d1:
  print("Yes")
else:
  print("No)

Submission status: Runtime Error

Solution code:
n = int(input())
lst = list(map(int,input().split()))
val = 0
for i in range(len(lst)-1):
  for j in range(i+1,len(lst)):
    val += (lst[i]*lst[j])
print(val%((10**9)+7))

Submission status: Runtime Error

Solution code:
D,T,S = map(input().split())
result = D / S
if T <= result :
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
u=0
u=int(input())
A = list(map(int,input().split()))
n = len(A)
prr = 0
for i in range(n):
    for j in range(i + 1, n):
        prr = prr + A[i] * A[j]
print(prr)