Skip to content

Instantly share code, notes, and snippets.

@iamsibasish
Created August 16, 2018 13:24
Show Gist options
  • Save iamsibasish/f9613cc074714219e38dcb75d43fbf3e to your computer and use it in GitHub Desktop.
Save iamsibasish/f9613cc074714219e38dcb75d43fbf3e to your computer and use it in GitHub Desktop.
Codeforce1003-A. Polycarp's Pockets created by sibasishmohanty - https://repl.it/@sibasishmohanty/Codeforce1003-A-Polycarps-Pockets
def solonA(arr):
count=1
dicc={}
for i in arr:
if i in dicc:
dicc[i]+=1
count=max(count,dicc[i])
else:
dicc[i]=1
print(count)
def solonB(a,b,x):
ans=""
last=""
if a>=b:
for i in range(0,x):
if i&1==0:
ans+="0"
a-=1
if i==x-1:
last = "0"
else:
ans+="1"
b-=1
if i==x-1:
last = "1"
else:
for i in range(0,x):
if i&1==1:
ans+="0"
a-=1
if i==x-1:
last = "0"
else:
ans+="1"
b-=1
if i==x-1:
last = "1"
print(last)
if last == "0":
if a>0:
while(a>0):
a-=1
ans+="0"
if b>0:
while(b>0):
b-=1
ans+="1"
else:
if b>0:
while(b>0):
b-=1
ans+="1"
if a>0:
while(a>0):
a-=1
ans+="0"
print(ans)
"""
if __name__ =="__main__":
arr = list(map(int,input().rstrip().split()))
solonB(arr[0],arr[1],arr[2])"""
def solC(arr,n,k):
ans = 0
for d in range(k,n+1):
print()
for i in range(0,n-d+1):
print("aaaa")
summ = 0
for j in range(i,i+d):
summ+=arr[j]
avg = summ/d
ans=max(ans,avg)
print(ans)
if __name__ =="__main__":
abc = list(map(int,input().rstrip().split()))
arr = list(map(int,input().rstrip().split()))
solC(arr,abc[0],abc[1])
arr = [3,4,1,2]
solC(arr,4,3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment