node_ids listlengths 4 1.4k | edge_index listlengths 1 2.22k | text listlengths 4 1.4k | source stringlengths 14 427k |
|---|---|---|---|
[
7,
15,
15,
15,
13,
15,
13,
15,
13,
15,
13,
41,
28,
13,
4,
18,
4,
18,
18,
13,
13,
13,
13,
4,
4,
13,
13,
12,
13,
12,
13,
41,
28,
13,
4,
18,
4,
18,
18,
13,
13,
13,
13,
4,
4,
13,
13,
12,
13,
12,
13,
0,
13,
4,
13,... | [
[
14,
13
],
[
13,
26
],
[
34,
33
],
[
33,
46
],
[
53,
52
],
[
52,
64
],
[
52,
69
],
[
52,
73
],
[
79,
78
],
[
88,
81
],
[
332,
84
],
[
88,
88
],
[
94,
93
],
[
... | [
"#!usr/bin/env python3\nfrom collections import defaultdict,deque\nfrom heapq import heappush, heappop\nimport sys\nimport math\nimport bisect\nimport random\ndef LI(): return [int(x) for x in sys.stdin.readline().split()]\ndef I(): return int(sys.stdin.readline())\ndef LS():return [list(x) for x in sys.stdin.readl... | #!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
28,
13,
4,
13,
17,
4,
13,
13,
14,
2,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
4,
13,
17,
28,
13,
4,
13,
17,
13,
4,
13,
13,
... | [
[
91,
2
],
[
91,
11
],
[
88,
13
],
[
26,
25
],
[
89,
31
],
[
89,
36
],
[
25,
37
],
[
89,
39
],
[
25,
41
],
[
92,
43
],
[
49,
48
],
[
25,
52
],
[
48,
55
],
[
... | [
"N,L=map(int,input().split())\n\na=list(map(int,input().split()))\n\n\nfor i in range(1,len(a)):\n if a[i]+a[i-1]<L:\n pass\n else:\n print(\"Possible\")\n for j in range(1,i):\n print(j)\n for k in range(len(a)-i-1):\n print(len(a)-1-k)\n print(i)\n ... | N,L=map(int,input().split())
a=list(map(int,input().split()))
for i in range(1,len(a)):
if a[i]+a[i-1]<L:
pass
else:
print("Possible")
for j in range(1,i):
print(j)
for k in range(len(a)-i-1):
print(len(a)-1-k)
print(i)
exit()
print("Imp... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
13,
28,
13,
4,
13,
17,
13,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
0,
13,
13,
14,
2,
13,
13,
4,
13,
17,
4,
... | [
[
90,
2
],
[
90,
11
],
[
93,
13
],
[
96,
25
],
[
88,
26
],
[
29,
28
],
[
88,
32
],
[
94,
37
],
[
28,
38
],
[
94,
40
],
[
28,
42
],
[
91,
44
],
[
84,
46
],
[
... | [
"N,L = map(int,input().split())\na = list(map(int,input().split()))\nx = N\nfor i in range(1,N):\n if a[i] + a[i-1] >= L:\n x = i\nif x == N:\n print('Impossible')\n exit()\nprint('Possible')\nfor i in range(1,x):\n print(i)\nfor i in range(N-1,x-1,-1):\n print(i)",
"N,L = map(int,input().sp... | N,L = map(int,input().split())
a = list(map(int,input().split()))
x = N
for i in range(1,N):
if a[i] + a[i-1] >= L:
x = i
if x == N:
print('Impossible')
exit()
print('Possible')
for i in range(1,x):
print(i)
for i in range(N-1,x-1,-1):
print(i)
|
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
28,
13,
39,
13,
13,
4,
13,
4,
13,
13,
18,
13,
39,
17,
14,
40,
2,
13,
13,
13,
4,
13,
17,
3,
4,
13,
17,
4,
13,
0,
13,
39,
... | [
[
103,
2
],
[
103,
11
],
[
109,
13
],
[
110,
33
],
[
110,
35
],
[
104,
43
],
[
106,
54
],
[
58,
57
],
[
107,
66
],
[
57,
68
],
[
71,
70
],
[
101,
74
],
[
107,
82
... | [
"N,L = map(int,input().split())\nA = list(map(int,input().split()))\n\nfor i,(a,b) in enumerate(zip(A,A[1:])):\n if a+b >= L:\n print('Possible')\n break\nelse:\n print('Impossible')\n exit()\nans = []\nfor j in range(1,i+1):\n ans.append(j)\nfor j in range(N-1,i+1,-1):\n ans.append(j)\... | N,L = map(int,input().split())
A = list(map(int,input().split()))
for i,(a,b) in enumerate(zip(A,A[1:])):
if a+b >= L:
print('Possible')
break
else:
print('Impossible')
exit()
ans = []
for j in range(1,i+1):
ans.append(j)
for j in range(N-1,i+1,-1):
ans.append(j)
ans.append(i+1)
pri... |
[
7,
15,
13,
0,
13,
18,
18,
13,
13,
13,
0,
13,
18,
18,
13,
13,
13,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
31,
13,
0,
13,
17,
28,
13,
39,
13,
13,
4,
13,
4,
13,
13,
18,
13,
39,
17,
14,
40,
2,
13,
13,
13,
0,
13,
... | [
[
113,
4
],
[
107,
11
],
[
110,
18
],
[
114,
25
],
[
110,
27
],
[
110,
28
],
[
116,
31
],
[
105,
52
],
[
119,
54
],
[
101,
68
],
[
120,
76
],
[
117,
76
],
[
120,
83... | [
"import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\n\nN, L, *a = map(int, read().split())\nknot = -1\nfor idx, (i, j) in enumerate(zip(a, a[1:])):\n if i + j >= L:\n knot = idx + 1\n print('Possible')\n break\nelse:\n print('Impossible')\n exit()\n\nanswer = list(range... | import sys
read = sys.stdin.read
readline = sys.stdin.readline
N, L, *a = map(int, read().split())
knot = -1
for idx, (i, j) in enumerate(zip(a, a[1:])):
if i + j >= L:
knot = idx + 1
print('Possible')
break
else:
print('Impossible')
exit()
answer = list(range(1, knot)) + list(ran... |
[
7,
41,
28,
13,
4,
18,
4,
13,
13,
17,
4,
4,
13,
13,
0,
13,
13,
13,
41,
28,
13,
4,
18,
4,
13,
13,
17,
4,
4,
13,
13,
0,
13,
13,
0,
13,
17,
28,
13,
4,
13,
17,
4,
13,
13,
0,
13,
2,
18,
13,
13,
18,
13,
2,
13,
17,... | [
[
4,
3
],
[
3,
13
],
[
106,
15
],
[
106,
17
],
[
21,
20
],
[
20,
30
],
[
109,
32
],
[
97,
35
],
[
39,
38
],
[
110,
44
],
[
94,
46
],
[
110,
49
],
[
38,
50
],
[
... | [
"N, L = [int(_) for _ in raw_input().split(\" \")]\nret = [int(_) for _ in raw_input().split(\" \")]\nindex = 0\nfor i in range(1, len(ret)):\n s = ret[i] + ret[i-1]\n if L <= s:\n index = i+1\n break\n\nif index == 0:\n print \"Impossible\"\nelse:\n print \"Possible\"\n for i in range(len(ret)-1, inde... | N, L = [int(_) for _ in raw_input().split(" ")]
ret = [int(_) for _ in raw_input().split(" ")]
index = 0
for i in range(1, len(ret)):
s = ret[i] + ret[i-1]
if L <= s:
index = i+1
break
if index == 0:
print "Impossible"
else:
print "Possible"
for i in range(len(ret)-1, index-1, -1):
print i
fo... |
[
7,
15,
13,
4,
18,
13,
13,
17,
0,
13,
4,
13,
17,
0,
13,
2,
2,
17,
17,
17,
0,
13,
12,
4,
18,
4,
18,
18,
13,
13,
13,
13,
12,
13,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
... | [
[
110,
9
],
[
119,
14
],
[
116,
21
],
[
36,
35
],
[
117,
42
],
[
36,
44
],
[
47,
46
],
[
117,
55
],
[
59,
58
],
[
35,
62
],
[
46,
68
],
[
58,
69
],
[
46,
71
],
... | [
"import sys\nsys.setrecursionlimit(2147483647)\nINF=float(\"inf\")\nMOD=10**9+7\ninput=lambda:sys.stdin.readline().rstrip()\ndef resolve():\n n,L=map(int,input().split())\n A=list(map(int,input().split()))\n\n for i in range(n-1):\n if(A[i]+A[i+1]>=L):\n print(\"Possible\")\n b... | import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda:sys.stdin.readline().rstrip()
def resolve():
n,L=map(int,input().split())
A=list(map(int,input().split()))
for i in range(n-1):
if(A[i]+A[i+1]>=L):
print("Possible")
break
else:
... |
[
7,
12,
13,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
0,
13,
13,
3,
14,
2,
13,
17,
29,
39,
17,
39,
41,
28,
13,
4,
13,
13,
4,
2,
13,
17,
0,
13,
13,
4,
18,
13,
13,
2,
1... | [
[
5,
4
],
[
8,
7
],
[
69,
11
],
[
73,
17
],
[
7,
18
],
[
73,
20
],
[
7,
22
],
[
71,
24
],
[
27,
26
],
[
7,
27
],
[
26,
31
],
[
4,
31
],
[
40,
39
],
[
26,
... | [
"#!/usr/bin/env python3\n\n\ndef solve(n, l, xs):\n pair_idx = None\n for i in range(n - 1):\n if xs[i] + xs[i + 1] >= l:\n pair_idx = i\n break\n if pair_idx is None:\n return (False, [])\n ans = [x + 1 for x in range(pair_idx)]\n ans.extend(x + 1 for x in range(p... | #!/usr/bin/env python3
def solve(n, l, xs):
pair_idx = None
for i in range(n - 1):
if xs[i] + xs[i + 1] >= l:
pair_idx = i
break
if pair_idx is None:
return (False, [])
ans = [x + 1 for x in range(pair_idx)]
ans.extend(x + 1 for x in range(pair_idx + 1, n - ... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
0,
13,
17,
0,
13,
13,
14,
13,
4,
13,
... | [
[
125,
2
],
[
125,
11
],
[
119,
13
],
[
110,
25
],
[
29,
28
],
[
117,
32
],
[
120,
38
],
[
28,
39
],
[
120,
41
],
[
28,
43
],
[
126,
45
],
[
122,
47
],
[
113,
50
... | [
"#%%\nn, l = map(int, input().split())\na = list(map(int, input().split()))\n\nflag = False\nfor i in range(n-1):\n if a[i] + a[i+1] >= l:\n flag = True\n pos = i\nif flag:\n print('Possible')\n for i in range(n-1):\n if i < pos:\n print(i+1)\n elif i == pos :\n ... | #%%
n, l = map(int, input().split())
a = list(map(int, input().split()))
flag = False
for i in range(n-1):
if a[i] + a[i+1] >= l:
flag = True
pos = i
if flag:
print('Possible')
for i in range(n-1):
if i < pos:
print(i+1)
elif i == pos :
break
for ... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
31,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
39,
17,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
0,
18,
13,
17,
2,
13,
17,
0,
13,
4,
... | [
[
97,
2
],
[
97,
11
],
[
15,
13
],
[
106,
24
],
[
29,
28
],
[
98,
32
],
[
28,
39
],
[
28,
43
],
[
95,
45
],
[
50,
47
],
[
107,
48
],
[
101,
48
],
[
104,
48
],
[... | [
"n,l=map(int,input().split())\n*a,=map(int,input().split())\nv=[0]\n\nfor i in range(n-1):\n if a[i]+a[i+1]>=l:\n v[0]=i+1\n v+=list(range(1,i+1)[::-1])\n v+=list(range(i+2,n))\n print(\"Possible\")\n print(*v[::-1],sep=\"\\n\")\n break\nelse:\n print(\"Impossible\")",
"n,l=map(int,input().spl... | n,l=map(int,input().split())
*a,=map(int,input().split())
v=[0]
for i in range(n-1):
if a[i]+a[i+1]>=l:
v[0]=i+1
v+=list(range(1,i+1)[::-1])
v+=list(range(i+2,n))
print("Possible")
print(*v[::-1],sep="\n")
break
else:
print("Impossible") |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
0,
13,
17,
0,
13,
13,
3,
... | [
[
105,
2
],
[
105,
11
],
[
111,
13
],
[
96,
25
],
[
114,
28
],
[
32,
31
],
[
100,
35
],
[
112,
41
],
[
31,
42
],
[
112,
44
],
[
31,
46
],
[
106,
48
],
[
102,
50
]... | [
"# coding: utf-8\n# Your code here!\nN,L=map(int,input().split())\nl=list(map(int,input().split()))\njudge=\"Impossible\"\nindex=0\n\nfor i in range(N-1):\n if (l[i]+l[i+1])>=L:\n judge=\"Possible\"\n index=i\n break\n\nprint(judge)\nif judge==\"Impossible\":\n exit()\n\nfor i in range(0,... | # coding: utf-8
# Your code here!
N,L=map(int,input().split())
l=list(map(int,input().split()))
judge="Impossible"
index=0
for i in range(N-1):
if (l[i]+l[i+1])>=L:
judge="Possible"
index=i
break
print(judge)
if judge=="Impossible":
exit()
for i in range(0,index):
print(i+1)
for ... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
14,
2,
13,
17,
14,
40,
4,
13,
13,
13,
4,
13,
17,
4,
13,
17,
4,
13,
17,
4,
13,
17,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
... | [
[
120,
2
],
[
120,
11
],
[
108,
13
],
[
121,
26
],
[
109,
32
],
[
112,
33
],
[
117,
47
],
[
51,
50
],
[
121,
54
],
[
109,
60
],
[
50,
61
],
[
109,
63
],
[
50,
65
... | [
"N,L=map(int,input().split())\nA=list(map(int,input().split()))\nif N==2:\n if sum(A)>=L:\n print('Possible')\n print(1)\n else:\n print('Impossible')\n exit(0)\nlasti=-1\nfor i in range(N-1):\n if A[i]+A[i+1]>=L:\n lasti=i+1\n break\nif lasti==-1:\n print('Impossible')\nelse:\n print('Possible... | N,L=map(int,input().split())
A=list(map(int,input().split()))
if N==2:
if sum(A)>=L:
print('Possible')
print(1)
else:
print('Impossible')
exit(0)
lasti=-1
for i in range(N-1):
if A[i]+A[i+1]>=L:
lasti=i+1
break
if lasti==-1:
print('Impossible')
else:
print('Possible')
for i in range(1,... |
[
7,
0,
13,
17,
0,
13,
17,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
2,
39,
17,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
0,
13,
17,
28,
13,
4,
13,
17,
13,
14,
2,
13,
2,
18,
13,
13,
18,
13,
2,
13,
... | [
[
118,
2
],
[
133,
5
],
[
139,
8
],
[
139,
17
],
[
127,
19
],
[
136,
34
],
[
142,
37
],
[
41,
40
],
[
140,
44
],
[
137,
47
],
[
131,
47
],
[
128,
50
],
[
40,
51
]... | [
"# def makelist(n, m):\n# \treturn [[0 for i in range(m)] for j in range(n)]\n\nyes = \"Possible\"\nno = \"Impossible\"\n\nN, L = map(int, input().split())\na = [0] + list(map(int, input().split()))\n\nc = 0\nMi = -1\nfor i in range(1, N):\n\tif c < a[i] + a[i+1]:\n\t\tc = max(c, a[i] + a[i+1])\n\t\tMi = i\n\nif c ... | # def makelist(n, m):
# return [[0 for i in range(m)] for j in range(n)]
yes = "Possible"
no = "Impossible"
N, L = map(int, input().split())
a = [0] + list(map(int, input().split()))
c = 0
Mi = -1
for i in range(1, N):
if c < a[i] + a[i+1]:
c = max(c, a[i] + a[i+1])
Mi = i
if c < L:
print(no)
else:
print(ye... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
28,
13,
4,
13,
17,
13,
14,
40,
2,
18,
13,
2,
13,
17,
18,
13,
13,
13,
4,
13,
17,
28,
13,
4,
13,
17,
13,
4,
13... | [
[
83,
2
],
[
83,
11
],
[
15,
14
],
[
14,
23
],
[
77,
25
],
[
29,
28
],
[
81,
32
],
[
78,
37
],
[
28,
39
],
[
78,
42
],
[
28,
43
],
[
84,
44
],
[
50,
49
],
[
... | [
"N, L = map(int, input().split())\nA = [int(a) for a in input().split()]\n\nfor i in range(1, N):\n if A[i-1] + A[i] >= L:\n print(\"Possible\")\n for j in range(1, i):\n print(j)\n for j in range(N-1, i, -1):\n print(j)\n print(i)\n break\nelse:\n prin... | N, L = map(int, input().split())
A = [int(a) for a in input().split()]
for i in range(1, N):
if A[i-1] + A[i] >= L:
print("Possible")
for j in range(1, i):
print(j)
for j in range(N-1, i, -1):
print(j)
print(i)
break
else:
print("Impossible") |
[
7,
15,
13,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
0,
13,
13,
3,
14,
2,
13,
2,
... | [
[
110,
4
],
[
110,
13
],
[
98,
15
],
[
101,
27
],
[
31,
30
],
[
105,
34
],
[
99,
40
],
[
30,
41
],
[
99,
43
],
[
30,
45
],
[
111,
47
],
[
107,
49
],
[
30,
50
],
... | [
"import sys\nn,x=map(int,input().split())\na=list(map(int,input().split()))\nk=-1\nfor i in range(n-1):\n if a[i]+a[i+1]>=x:\n k=i\n break\n if i==n-2:\n print('Impossible')\n sys.exit()\nprint('Possible')\nfor i in range(k):\n print(i+1)\nfor i in range(n-2,k,-1):\n print(i+1)\nprint(k+1)",
"impo... | import sys
n,x=map(int,input().split())
a=list(map(int,input().split()))
k=-1
for i in range(n-1):
if a[i]+a[i+1]>=x:
k=i
break
if i==n-2:
print('Impossible')
sys.exit()
print('Possible')
for i in range(k):
print(i+1)
for i in range(n-2,k,-1):
print(i+1)
print(k+1) |
[
7,
12,
13,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
4,
13,
17,
28,
13,
4,
13,
13,
4,
13,
2,
... | [
[
5,
4
],
[
5,
13
],
[
16,
15
],
[
28,
27
],
[
4,
31
],
[
15,
37
],
[
27,
38
],
[
15,
40
],
[
27,
42
],
[
13,
44
],
[
50,
49
],
[
27,
52
],
[
49,
56
],
[
60... | [
"def resolve():\n n, l = map(int, input().split())\n a = list(map(int, input().split()))\n for i in range(n - 1):\n if a[i] + a[i + 1] >= l:\n print(\"Possible\")\n for j in range(i):\n print(j + 1)\n for j in range(n - 1, i, -1):\n prin... | def resolve():
n, l = map(int, input().split())
a = list(map(int, input().split()))
for i in range(n - 1):
if a[i] + a[i + 1] >= l:
print("Possible")
for j in range(i):
print(j + 1)
for j in range(n - 1, i, -1):
print(j)
... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
0,
13,
13,
3,
14,
2,
13,
... | [
[
106,
2
],
[
106,
11
],
[
15,
14
],
[
14,
23
],
[
103,
25
],
[
100,
28
],
[
32,
31
],
[
98,
35
],
[
104,
41
],
[
31,
42
],
[
104,
44
],
[
31,
46
],
[
107,
48
],
... | [
"N,L=map(int,input().split())\na=[int(i) for i in input().split()]\nj=-1\nfor i in range(N-1):\n if a[i]+a[i+1]>=L:\n j=i\n break\nif j==-1:\n print(\"Impossible\")\nelse:\n print(\"Possible\")\n for i in range(j):\n print(i+1)\n for i in range(j+1,N-1)[::-1]:\n print(i+1)... | N,L=map(int,input().split())
a=[int(i) for i in input().split()]
j=-1
for i in range(N-1):
if a[i]+a[i+1]>=L:
j=i
break
if j==-1:
print("Impossible")
else:
print("Possible")
for i in range(j):
print(i+1)
for i in range(j+1,N-1)[::-1]:
print(i+1)
print(j+1)
|
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
31,
13,
4,
13,
13,
4,
18,
4,
13,
13,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
4,
13,
17,
4,
13,
31,
18,
4,
13,
2,
13,
17,
13,
39,... | [
[
80,
2
],
[
80,
11
],
[
15,
13
],
[
25,
24
],
[
81,
28
],
[
24,
35
],
[
24,
39
],
[
78,
41
],
[
24,
52
],
[
81,
54
],
[
59,
58
],
[
24,
67
],
[
71,
70
],
[
... | [
"n,l=map(int,input().split())\n*a,=map(int,input().split())\n\nfor i in range(n-1):\n if a[i]+a[i+1]>=l:\n print(\"Possible\")\n print(*range(i+2,n)[::-1],sep=\"\\n\")\n print(*range(1,i+2),sep=\"\\n\")\n break\nelse:\n print(\"Impossible\")",
"n,l=map(int,input().split())",
"n",
"map(int,input(... | n,l=map(int,input().split())
*a,=map(int,input().split())
for i in range(n-1):
if a[i]+a[i+1]>=l:
print("Possible")
print(*range(i+2,n)[::-1],sep="\n")
print(*range(1,i+2),sep="\n")
break
else:
print("Impossible") |
[
7,
15,
13,
15,
13,
15,
13,
15,
13,
15,
13,
4,
18,
13,
13,
2,
17,
17,
0,
13,
2,
17,
17,
0,
13,
2,
2,
17,
17,
17,
0,
13,
12,
4,
13,
4,
18,
4,
18,
18,
13,
13,
13,
13,
0,
13,
12,
4,
13,
13,
4,
18,
4,
18,
4,
18,... | [
[
238,
19
],
[
241,
24
],
[
229,
31
],
[
232,
45
],
[
235,
63
],
[
244,
83
],
[
112,
111
],
[
236,
113
],
[
112,
114
],
[
117,
116
],
[
236,
118
],
[
121,
120
],
[
124,... | [
"import sys\nimport math\nimport collections\nimport bisect\nimport itertools\n\n# import numpy as np\n\nsys.setrecursionlimit(10 ** 7)\nINF = 10 ** 20\nMOD = 10 ** 9 + 7\n# MOD = 998244353\n\nni = lambda: int(sys.stdin.readline().rstrip())\nns = lambda: map(int, sys.stdin.readline().rstrip().split())\nna = lambda:... | import sys
import math
import collections
import bisect
import itertools
# import numpy as np
sys.setrecursionlimit(10 ** 7)
INF = 10 ** 20
MOD = 10 ** 9 + 7
# MOD = 998244353
ni = lambda: int(sys.stdin.readline().rstrip())
ns = lambda: map(int, sys.stdin.readline().rstrip().split())
na = lambda: list(map(int, sys.s... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
41,
28,
13,
4,
13,
2,
13,
17,
4,
2,
18,
13,
13,
18,
13,
2,
13,
17,
0,
13,
13,
0,
13,
4,
13,
13,
0,
13,
4,
18,
13,
13,
13,
14,
... | [
[
99,
2
],
[
99,
11
],
[
93,
13
],
[
25,
24
],
[
97,
28
],
[
94,
33
],
[
24,
34
],
[
94,
36
],
[
24,
38
],
[
102,
41
],
[
105,
44
],
[
103,
47
],
[
90,
49
],
[
... | [
"N, L = map(int, raw_input().split())\na = map(int, raw_input().split())\nb = [a[i]+a[i+1] for i in xrange(N-1)]\nmaxb = max(b)\nmaxbi = b.index(maxb)\nif maxb < L:\n print 'Impossible'\n exit()\nprint 'Possible'\nfor i in xrange(maxbi):\n print i+1\nfor i in xrange(N-2, maxbi, -1):\n print i+1\nprint m... | N, L = map(int, raw_input().split())
a = map(int, raw_input().split())
b = [a[i]+a[i+1] for i in xrange(N-1)]
maxb = max(b)
maxbi = b.index(maxb)
if maxb < L:
print 'Impossible'
exit()
print 'Possible'
for i in xrange(maxbi):
print i+1
for i in xrange(N-2, maxbi, -1):
print i+1
print maxbi+1
|
[
7,
15,
13,
0,
13,
18,
18,
13,
13,
13,
4,
18,
13,
13,
2,
17,
17,
17,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
41,
28,
13,
13,
4,
13,
13,
18,
13,
39,
17,
... | [
[
133,
4
],
[
148,
19
],
[
134,
26
],
[
148,
28
],
[
32,
31
],
[
134,
35
],
[
31,
40
],
[
124,
42
],
[
125,
50
],
[
125,
52
],
[
127,
60
],
[
145,
63
],
[
128,
66
... | [
"import sys\ninput = sys.stdin.readline\nsys.setrecursionlimit(10 ** 7)\n\n\"\"\"\n逆再生。長さL以上になるものをくっつけられる。\n一度L以上になったらそこだけ見ていけばよい\n\"\"\"\n\nN,L = map(int,input().split())\nA = [int(x) for x in input().split()]\n\nA2 = [x+y for x,y in zip(A,A[1:])]\n\nM = max(A2)\ni = A2.index(M)\nif M < L:\n answer = ['Impossib... | import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
"""
逆再生。長さL以上になるものをくっつけられる。
一度L以上になったらそこだけ見ていけばよい
"""
N,L = map(int,input().split())
A = [int(x) for x in input().split()]
A2 = [x+y for x,y in zip(A,A[1:])]
M = max(A2)
i = A2.index(M)
if M < L:
answer = ['Impossible']
else:
answer = ['Po... |
[
7,
12,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
0,
13,
17,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
14,
2,
13,
2,
18,
13,
13,
18,
13,... | [
[
6,
5
],
[
5,
14
],
[
17,
16
],
[
17,
18
],
[
22,
21
],
[
21,
30
],
[
33,
32
],
[
36,
35
],
[
39,
38
],
[
42,
41
],
[
16,
45
],
[
35,
49
],
[
60,
49
],
[
3... | [
"def main():\n N, L = (int(i) for i in input().split())\n A = [int(i) for i in input().split()]\n\n ma = 0\n idx = -1\n for i in range(N-1):\n if ma < A[i] + A[i+1]:\n ma = A[i] + A[i+1]\n idx = i+1\n if ma < L:\n return print(\"Impossible\")\n print(\"Possib... | def main():
N, L = (int(i) for i in input().split())
A = [int(i) for i in input().split()]
ma = 0
idx = -1
for i in range(N-1):
if ma < A[i] + A[i+1]:
ma = A[i] + A[i+1]
idx = i+1
if ma < L:
return print("Impossible")
print("Possible")
for i in ra... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
4,
13,
17,
0,
13,
13,
3,
4,
13,
17,
4,
13,
14,
... | [
[
114,
2
],
[
114,
11
],
[
117,
13
],
[
26,
25
],
[
109,
29
],
[
118,
35
],
[
25,
36
],
[
118,
38
],
[
25,
40
],
[
115,
42
],
[
105,
47
],
[
25,
48
],
[
106,
57
]... | [
"n,k = map(int,input().split())\na = list(map(int,input().split()))\nfor i in range(n-1):\n if a[i]+a[i+1] >= k:\n print(\"Possible\")\n x = i\n break\nelse:\n print(\"Impossible\")\n exit()\nif x == 0:\n print(*list(range(1,n))[::-1],sep=\"\\n\")\nelse:\n ans = list(range(1,n))\n ans[x:] = ans[n-1:x... | n,k = map(int,input().split())
a = list(map(int,input().split()))
for i in range(n-1):
if a[i]+a[i+1] >= k:
print("Possible")
x = i
break
else:
print("Impossible")
exit()
if x == 0:
print(*list(range(1,n))[::-1],sep="\n")
else:
ans = list(range(1,n))
ans[x:] = ans[n-1:x-1:-1]
print(*ans,sep="\... |
[
7,
12,
13,
29,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
39,
13,
13,
4,
13,
0,
13,
4,
13,
28,
13,
4,
13,
2,
13,
17,
14,
2,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
9,
4,
13,
17,
28,
13,
4,
13,
17,
2,
13,
17,
4,
... | [
[
18,
15
],
[
78,
19
],
[
80,
21
],
[
78,
23
],
[
26,
25
],
[
81,
35
],
[
25,
36
],
[
81,
38
],
[
25,
40
],
[
49,
48
],
[
25,
53
],
[
48,
57
],
[
60,
59
],
[
... | [
"def get_ints():\n return list(map(int, input().split()))\n\n[n, l] = get_ints()\na = get_ints()\n\nfor i in range(n - 1):\n if a[i] + a[i + 1] < l:\n continue\n print(\"Possible\")\n for j in range(1, i + 1):\n print(j)\n for j in range(n - 1, i, -1):\n print(j)\n exit(0)\n\n... | def get_ints():
return list(map(int, input().split()))
[n, l] = get_ints()
a = get_ints()
for i in range(n - 1):
if a[i] + a[i + 1] < l:
continue
print("Possible")
for j in range(1, i + 1):
print(j)
for j in range(n - 1, i, -1):
print(j)
exit(0)
print("Impossible")
|
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
0,
13,
2,
18,
13,
13,
18,
13,
2,
13,
17,
14,
40,
13,
13,
0,
13,
17,
0,
... | [
[
131,
2
],
[
131,
11
],
[
113,
13
],
[
122,
25
],
[
125,
28
],
[
32,
31
],
[
132,
35
],
[
128,
38
],
[
114,
41
],
[
31,
42
],
[
114,
44
],
[
31,
46
],
[
129,
50
... | [
"n,l = map(int, input().split())\na = list(map(int, input().split()))\nans = \"Impossible\"\nlast = 0\n\nfor i in range(n-1):\n A = a[i]+a[i+1]\n if A>=l:\n ans= \"Possible\"\n last = i+1\n break\n\nif ans==\"Impossible\":\n print(ans)\nelse:\n print(ans)\n\n if last!=1:\n ... | n,l = map(int, input().split())
a = list(map(int, input().split()))
ans = "Impossible"
last = 0
for i in range(n-1):
A = a[i]+a[i+1]
if A>=l:
ans= "Possible"
last = i+1
break
if ans=="Impossible":
print(ans)
else:
print(ans)
if last!=1:
for i in range(last-1):
... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
28,
13,
4,
13,
17,
13,
14,
40,
2,
18,
13,
2,
13,
17,
18,
13,
13,
13,
0,
13,
13,
3,
4,
13,
17,
4,
13,
0,
13,
39,
28,
13,
... | [
[
98,
2
],
[
98,
11
],
[
104,
13
],
[
26,
25
],
[
96,
29
],
[
105,
34
],
[
25,
36
],
[
105,
39
],
[
25,
40
],
[
99,
41
],
[
107,
43
],
[
25,
44
],
[
101,
52
],
... | [
"N, L = map(int, input().split())\nA = list(map(int, input().split()))\n\nfor i in range(1, N):\n if A[i-1] + A[i] >= L:\n X = i\n break\nelse:\n print(\"Impossible\")\n exit()\n\nans = []\nfor i in range(1, X):\n ans.append(i)\nfor i in range(N-1, X, -1):\n ans.append(i)\nans.append(X)... | N, L = map(int, input().split())
A = list(map(int, input().split()))
for i in range(1, N):
if A[i-1] + A[i] >= L:
X = i
break
else:
print("Impossible")
exit()
ans = []
for i in range(1, X):
ans.append(i)
for i in range(N-1, X, -1):
ans.append(i)
ans.append(X)
print("Possible")
prin... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
17,
17,
0,
13,
17,
28,
13,
4,
13,
17,
13,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
0,
13,
13,
3,
14,... | [
[
117,
2
],
[
117,
11
],
[
108,
13
],
[
109,
26
],
[
111,
31
],
[
35,
34
],
[
106,
38
],
[
109,
43
],
[
34,
44
],
[
109,
46
],
[
34,
48
],
[
118,
50
],
[
114,
52
... | [
"N,L = map(int,input().split())\nA = list(map(int,input().split()))\nA.insert(0,0)\nflag = 0\nfor i in range(1,N):\n if A[i]+A[i+1]>=L:\n flag = i\n break\nif flag == 0:\n print(\"Impossible\")\nelse:\n print(\"Possible\")\n if flag==1:\n for i in range(N-1,0,-1):\n print... | N,L = map(int,input().split())
A = list(map(int,input().split()))
A.insert(0,0)
flag = 0
for i in range(1,N):
if A[i]+A[i+1]>=L:
flag = i
break
if flag == 0:
print("Impossible")
else:
print("Possible")
if flag==1:
for i in range(N-1,0,-1):
print(i)
else:
f... |
[
7,
12,
13,
0,
13,
39,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
4,
18,
13,
13,
2,
13,
17,
0,
13,
13,
3,
29,
13,
28,
13,
4,
13,
2,
13,
17,
2,
13,
17,
4,
18,
13,
13,
2,
13,
17,
2... | [
[
5,
4
],
[
8,
7
],
[
74,
11
],
[
78,
17
],
[
7,
18
],
[
78,
20
],
[
7,
22
],
[
76,
24
],
[
4,
27
],
[
7,
30
],
[
34,
33
],
[
7,
34
],
[
4,
37
],
[
40,
... | [
"\ndef knot(N, L, a):\n res = []\n for i in range(N - 1):\n if a[i] + a[i + 1] >= L:\n res.append(i + 1)\n start = i\n break\n else:\n return res\n\n for i in range(start + 1, N - 1):\n res.append(i + 1)\n for i in range(start - 1, -1, -1):\n ... |
def knot(N, L, a):
res = []
for i in range(N - 1):
if a[i] + a[i + 1] >= L:
res.append(i + 1)
start = i
break
else:
return res
for i in range(start + 1, N - 1):
res.append(i + 1)
for i in range(start - 1, -1, -1):
res.append(i + 1... |
[
7,
15,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
17,
13,
14,
40,
2,
18,
13,
2,
13,
17,
18,
13,
13,
13,
0,
13,
13,
14,
2,
13,
17,
4,
13,
17,... | [
[
96,
3
],
[
96,
12
],
[
93,
14
],
[
87,
26
],
[
30,
29
],
[
97,
33
],
[
94,
38
],
[
29,
40
],
[
94,
43
],
[
29,
44
],
[
91,
45
],
[
84,
47
],
[
29,
48
],
[
... | [
"from collections import deque\nn, l = map(int, input().split())\na = list(map(int, input().split()))\nlast = -1\nfor i in range(1,n):\n if a[i-1] + a[i] >= l :\n last = i\nif last == -1:\n print(\"Impossible\")\nelse:\n print(\"Possible\")\n for i in range(1, last):\n print(i)\n for i ... | from collections import deque
n, l = map(int, input().split())
a = list(map(int, input().split()))
last = -1
for i in range(1,n):
if a[i-1] + a[i] >= l :
last = i
if last == -1:
print("Impossible")
else:
print("Possible")
for i in range(1, last):
print(i)
for i in range(n-1,last,-1):... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
0,
13,
39,
28,
13,
4,
13,
2,
13,
17,
4,
18,
13,
13,
2,
18,
13,
13,
18,
13,
2,
13,
17,
14,
40,
4,
13,
13,
13,... | [
[
124,
2
],
[
124,
11
],
[
15,
14
],
[
14,
23
],
[
127,
25
],
[
130,
28
],
[
32,
31
],
[
125,
35
],
[
131,
39
],
[
128,
43
],
[
31,
44
],
[
128,
46
],
[
31,
48
],... | [
"n, l = map(int, input().split())\na = [int(i) for i in input().split()]\nb = []\nfor i in range(n-1):\n b.append(a[i] + a[i+1])\nif max(b) >= l:\n ans = \"Possible\"\nelse:\n ans = \"Impossible\"\nprint(ans)\nif ans == \"Possible\":\n k = b.index(max(b))\n ans = list(range(1, k + 1)) + list(range(n ... | n, l = map(int, input().split())
a = [int(i) for i in input().split()]
b = []
for i in range(n-1):
b.append(a[i] + a[i+1])
if max(b) >= l:
ans = "Possible"
else:
ans = "Impossible"
print(ans)
if ans == "Possible":
k = b.index(max(b))
ans = list(range(1, k + 1)) + list(range(n - 1, k + 1, -1)) + [k +... |
[
7,
15,
13,
0,
13,
18,
18,
13,
13,
13,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
4,
13,
17,
28... | [
[
89,
4
],
[
95,
11
],
[
90,
18
],
[
95,
20
],
[
92,
22
],
[
90,
31
],
[
35,
34
],
[
96,
38
],
[
93,
44
],
[
34,
45
],
[
93,
47
],
[
34,
49
],
[
87,
51
],
[
... | [
"import sys\ninput = sys.stdin.readline\n\nN, L = map(int, input().split())\na = list(map(int, input().split()))\nfor i in range(N-1):\n if a[i] + a[i+1] >= L:\n print('Possible')\n for j in range(1, i+1):\n print(j)\n for j in range(i+1, N)[::-1]:\n print(j)\n e... | import sys
input = sys.stdin.readline
N, L = map(int, input().split())
a = list(map(int, input().split()))
for i in range(N-1):
if a[i] + a[i+1] >= L:
print('Possible')
for j in range(1, i+1):
print(j)
for j in range(i+1, N)[::-1]:
print(j)
exit()
print('Impo... |
[
7,
15,
13,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
4,
13,
17,
0,
13,
2,
13,
17,... | [
[
91,
4
],
[
91,
13
],
[
17,
16
],
[
16,
25
],
[
97,
27
],
[
31,
30
],
[
92,
34
],
[
98,
40
],
[
30,
41
],
[
98,
43
],
[
30,
45
],
[
89,
47
],
[
94,
52
],
[
... | [
"import sys\nN, L = map(int, input().split())\nA = [int(_) for _ in input().split()]\n\n\nfor n in range(N - 1):\n if A[n] + A[n + 1] >= L:\n print('Possible')\n tmp_ind = n + 1\n for m in range(1, tmp_ind):\n print(m)\n for m in range(N - 1, tmp_ind, -1):\n prin... | import sys
N, L = map(int, input().split())
A = [int(_) for _ in input().split()]
for n in range(N - 1):
if A[n] + A[n + 1] >= L:
print('Possible')
tmp_ind = n + 1
for m in range(1, tmp_ind):
print(m)
for m in range(N - 1, tmp_ind, -1):
print(m)
prin... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
0,
13,
2,
13,
17,
3,
14,
2,
13,
17,
... | [
[
92,
2
],
[
92,
11
],
[
95,
13
],
[
98,
25
],
[
29,
28
],
[
93,
32
],
[
96,
38
],
[
28,
39
],
[
96,
41
],
[
28,
43
],
[
87,
45
],
[
89,
47
],
[
28,
49
],
[
... | [
"N,L = map(int,input().split())\nA = list(map(int,input().split()))\n\nlast = 0\nfor i in range(N-1):\n if A[i] + A[i+1] >= L:\n last = i+1\n break\nif last == 0:\n print('Impossible')\nelse:\n print('Possible')\n for i in range(1,last):\n print(i)\n for i in range(N-1,last-1,-1):\n print(i)",
"N... | N,L = map(int,input().split())
A = list(map(int,input().split()))
last = 0
for i in range(N-1):
if A[i] + A[i+1] >= L:
last = i+1
break
if last == 0:
print('Impossible')
else:
print('Possible')
for i in range(1,last):
print(i)
for i in range(N-1,last-1,-1):
print(i)
|
[
7,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
0,
13,
17,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
0,
13,
2,
18,
13,
13,
18,
13,
2,
13,
17,
... | [
[
4,
3
],
[
3,
12
],
[
121,
14
],
[
121,
16
],
[
20,
19
],
[
19,
28
],
[
124,
30
],
[
115,
33
],
[
112,
36
],
[
40,
39
],
[
104,
43
],
[
106,
46
],
[
125,
49
],
... | [
"#C\n#各ペアについてみていき、一つでもl以上⇔Possible\n\nn,l = [int(i) for i in input().split()]\na = [int(i) for i in input().split()]\n\nmaxsum=0\nmaxind = 0\nfor i in range(n-1):\n s = a[i]+a[i+1]\n if s > maxsum:\n maxsum = s\n maxind = i+1\n\nif maxsum<l:\n print(\"Impossible\")\nelse:\n print(\"Possi... | #C
#各ペアについてみていき、一つでもl以上⇔Possible
n,l = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
maxsum=0
maxind = 0
for i in range(n-1):
s = a[i]+a[i+1]
if s > maxsum:
maxsum = s
maxind = i+1
if maxsum<l:
print("Impossible")
else:
print("Possible")
for i in range(... |
[
7,
15,
13,
15,
13,
0,
13,
4,
13,
13,
4,
18,
4,
18,
13,
13,
17,
2,
17,
17,
13,
13,
31,
13,
12,
13,
0,
13,
4,
13,
13,
41,
28,
13,
13,
4,
13,
13,
18,
13,
39,
17,
4,
40,
2,
13,
13,
13,
0,
13,
13,
14,
40,
4,
13,
... | [
[
112,
6
],
[
112,
21
],
[
112,
22
],
[
28,
27
],
[
100,
30
],
[
100,
37
],
[
100,
39
],
[
98,
47
],
[
50,
49
],
[
49,
55
],
[
65,
64
],
[
49,
67
],
[
72,
71
],
... | [
"import sys\nimport os\n\nN, L, *A = map(int, os.read(0, 10**8).split())\n\ndef main(L, A):\n N = len(A)\n is_long = [x + y >= L for x, y in zip(A, A[1:])]\n if not any(is_long):\n print('Impossible')\n return\n print('Possible')\n i = is_long.index(True)\n nums = list(range(1, i + 1... | import sys
import os
N, L, *A = map(int, os.read(0, 10**8).split())
def main(L, A):
N = len(A)
is_long = [x + y >= L for x, y in zip(A, A[1:])]
if not any(is_long):
print('Impossible')
return
print('Possible')
i = is_long.index(True)
nums = list(range(1, i + 1)) + list(range(N ... |
[
7,
12,
13,
15,
13,
0,
13,
18,
18,
18,
13,
13,
13,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
1... | [
[
7,
6
],
[
17,
16
],
[
6,
20
],
[
16,
25
],
[
28,
27
],
[
28,
29
],
[
33,
32
],
[
6,
36
],
[
32,
41
],
[
44,
43
],
[
47,
46
],
[
50,
49
],
[
27,
53
],
[
29... | [
"def main():\n import sys\n input = sys.stdin.buffer.readline\n N, L = (int(i) for i in input().split())\n A = [int(i) for i in input().split()]\n last = -1\n for i in range(N-1):\n if L <= A[i] + A[i+1]:\n last = i+1\n if last < 0:\n return print(\"Impossible\")\n a... | def main():
import sys
input = sys.stdin.buffer.readline
N, L = (int(i) for i in input().split())
A = [int(i) for i in input().split()]
last = -1
for i in range(N-1):
if L <= A[i] + A[i+1]:
last = i+1
if last < 0:
return print("Impossible")
ans = [i for i in r... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
0,
13,
17,
0,
13,
39,
28,
13,
4,
13,
17,
2,
13,
17,
14,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
... | [
[
124,
2
],
[
124,
11
],
[
127,
13
],
[
133,
25
],
[
112,
28
],
[
121,
31
],
[
35,
34
],
[
125,
39
],
[
134,
43
],
[
131,
43
],
[
128,
49
],
[
34,
50
],
[
128,
52
... | [
"N, M = map(int, input().split())\nL = list(map(int, input().split()))\n\ncount = 0\nvouch = 0\nA = []\n\nfor i in range (0, N-1):\n\tif count == 0:\n\t\tif L[i]+L[i+1] >= M:\n\t\t\tcount=1\n\t\t\tA.append(N-1)\n\t\telse:\n\t\t\tA.append(i+1)\n\telse:\n\t\tA.append(N-2-vouch)\n\t\tvouch+=1\n\nif count == 0:\n\tprin... | N, M = map(int, input().split())
L = list(map(int, input().split()))
count = 0
vouch = 0
A = []
for i in range (0, N-1):
if count == 0:
if L[i]+L[i+1] >= M:
count=1
A.append(N-1)
else:
A.append(i+1)
else:
A.append(N-2-vouch)
vouch+=1
if count == 0:
print('Impossible')
exit()
else:
print('Possib... |
[
7,
15,
13,
0,
13,
12,
4,
18,
4,
18,
18,
13,
13,
13,
13,
4,
18,
13,
13,
4,
13,
17,
2,
17,
17,
0,
13,
12,
4,
18,
18,
13,
13,
13,
2,
13,
17,
23,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,... | [
[
159,
4
],
[
162,
26
],
[
141,
39
],
[
160,
46
],
[
141,
48
],
[
156,
50
],
[
160,
59
],
[
63,
62
],
[
139,
66
],
[
157,
72
],
[
62,
73
],
[
157,
75
],
[
62,
77
... | [
"import sys\ninput = lambda : sys.stdin.readline().rstrip()\nsys.setrecursionlimit(max(1000, 10**9))\nwrite = lambda x: sys.stdout.write(x+\"\\n\")\n\n\nn,l = map(int, input().split())\na = list(map(int, input().split()))\n\nfor i in range(n-1):\n if a[i]+a[i+1]>=l:\n ans = [\"Possible\"]\n ans += ... | import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")
n,l = map(int, input().split())
a = list(map(int, input().split()))
for i in range(n-1):
if a[i]+a[i+1]>=l:
ans = ["Possible"]
ans += [j for j in range(1,i+... |
[
7,
15,
13,
4,
18,
13,
13,
2,
17,
17,
0,
13,
18,
18,
13,
13,
13,
0,
13,
4,
13,
17,
0,
13,
2,
2,
17,
17,
17,
12,
13,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
... | [
[
141,
11
],
[
138,
18
],
[
144,
23
],
[
33,
32
],
[
142,
39
],
[
33,
41
],
[
44,
43
],
[
142,
52
],
[
56,
55
],
[
59,
58
],
[
32,
62
],
[
43,
67
],
[
58,
68
],
... | [
"import sys\n\nsys.setrecursionlimit(10 ** 7)\ninput = sys.stdin.readline\nf_inf = float('inf')\nmod = 10 ** 9 + 7\n\n\ndef resolve():\n n, L = map(int, input().split())\n A = list(map(int, input().split()))\n\n init = -1\n for i in range(1, n):\n if A[i] + A[i - 1] >= L:\n init = i\n ... | import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7
def resolve():
n, L = map(int, input().split())
A = list(map(int, input().split()))
init = -1
for i in range(1, n):
if A[i] + A[i - 1] >= L:
init = i
break
... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
0,
13,
2,
13,
17,
3,
4,
13,
17,
4,
13,
4,
13,
... | [
[
91,
2
],
[
91,
11
],
[
82,
13
],
[
26,
25
],
[
92,
29
],
[
83,
35
],
[
25,
36
],
[
83,
38
],
[
25,
40
],
[
89,
42
],
[
85,
44
],
[
25,
46
],
[
59,
58
],
[
... | [
"n, l = map(int, input().split())\nA = list(map(int, input().split()))\nfor i in range(n-1):\n if A[i]+A[i+1] >= l:\n f = i+1\n break\nelse:\n print(\"Impossible\")\n exit()\nprint(\"Possible\")\nfor i in range(1, f):\n print(i)\nfor i in range(n-1, f, -1):\n print(i)\nprint(f)",
"n, l = map(int, input... | n, l = map(int, input().split())
A = list(map(int, input().split()))
for i in range(n-1):
if A[i]+A[i+1] >= l:
f = i+1
break
else:
print("Impossible")
exit()
print("Possible")
for i in range(1, f):
print(i)
for i in range(n-1, f, -1):
print(i)
print(f) |
[
7,
15,
13,
15,
13,
15,
4,
18,
13,
13,
2,
17,
17,
12,
13,
29,
18,
4,
18,
18,
13,
13,
13,
39,
17,
0,
13,
2,
2,
17,
17,
17,
12,
13,
12,
13,
12,
13,
14,
40,
13,
17,
41,
28,
13,
4,
13,
13,
4,
39,
29,
13,
14,
2,
13... | [
[
165,
26
],
[
88,
40
],
[
45,
44
],
[
90,
47
],
[
90,
54
],
[
59,
58
],
[
88,
61
],
[
169,
64
],
[
70,
69
],
[
88,
72
],
[
175,
75
],
[
78,
77
],
[
77,
86
],
[... | [
"import sys\nimport math\nfrom collections import defaultdict\n\nsys.setrecursionlimit(10**7)\ndef input():\n return sys.stdin.readline()[:-1]\n\nmod = 10**9 + 7\n\ndef I(): return int(input())\ndef LI(): return list(map(int, input().split()))\ndef LIR(row,col):\n if row <= 0:\n return [[] for _ in ran... | import sys
import math
from collections import defaultdict
sys.setrecursionlimit(10**7)
def input():
return sys.stdin.readline()[:-1]
mod = 10**9 + 7
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def LIR(row,col):
if row <= 0:
return [[] for _ in range(col)]
elif c... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
31,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
14,
40,
13,
2,
18,
13,
2,
13,
17,
18,
13,
13,
0,
13,
13,
0,
13,
2,
18,
13,
... | [
[
104,
2
],
[
104,
11
],
[
15,
13
],
[
110,
24
],
[
101,
27
],
[
31,
30
],
[
99,
34
],
[
111,
38
],
[
96,
38
],
[
30,
43
],
[
30,
47
],
[
107,
49
],
[
30,
50
],
... | [
"n,l=map(int, input().split())\n*a,=map(int, input().split())\nmx=0\nind=-1\nfor i in range(n-1):\n if mx<=a[i+1]+a[i]:\n ind=i\n mx=a[i+1]+a[i]\nif mx>=l:\n print(\"Possible\")\n for i in range(ind):\n print(i+1)\n for i in range(n-1,ind,-1):\n print(i)\nelse:\n print(\"I... | n,l=map(int, input().split())
*a,=map(int, input().split())
mx=0
ind=-1
for i in range(n-1):
if mx<=a[i+1]+a[i]:
ind=i
mx=a[i+1]+a[i]
if mx>=l:
print("Possible")
for i in range(ind):
print(i+1)
for i in range(n-1,ind,-1):
print(i)
else:
print("Impossible") |
[
7,
12,
13,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
13,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
0,
13,
13,
3,
14,
2,
13,
13,
... | [
[
5,
4
],
[
5,
13
],
[
16,
15
],
[
28,
27
],
[
4,
28
],
[
31,
30
],
[
4,
34
],
[
15,
40
],
[
30,
41
],
[
15,
43
],
[
30,
45
],
[
13,
47
],
[
50,
49
],
[
30,... | [
"#! /usr/bin/env python3\n\ndef main():\n N, L = map(int, input().split())\n A = list(map(int, input().split()))\n la = N\n for i in range(N-1):\n if A[i] + A[i+1] >= L:\n la = i\n break\n if la == N:\n print('Impossible')\n return\n print('Possible')\n ... | #! /usr/bin/env python3
def main():
N, L = map(int, input().split())
A = list(map(int, input().split()))
la = N
for i in range(N-1):
if A[i] + A[i+1] >= L:
la = i
break
if la == N:
print('Impossible')
return
print('Possible')
for i in range(la... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
0,
13,
17,
0,
13,
2,
13,
17,
3,
14,
... | [
[
101,
2
],
[
101,
11
],
[
95,
13
],
[
104,
25
],
[
29,
28
],
[
90,
32
],
[
96,
38
],
[
28,
39
],
[
96,
41
],
[
28,
43
],
[
102,
45
],
[
92,
47
],
[
98,
50
],
[... | [
"N,L=map(int,input().split())\nA=list(map(int,input().split()))\nflag=False\nfor i in range(N-1):\n if A[i]+A[i+1]>=L:\n flag=True\n idx=i+1\n break\nif not flag:\n print('Impossible')\nelse:\n print('Possible')\n for i in range(1,idx):\n print(i)\n for i in range(N-1,idx,... | N,L=map(int,input().split())
A=list(map(int,input().split()))
flag=False
for i in range(N-1):
if A[i]+A[i+1]>=L:
flag=True
idx=i+1
break
if not flag:
print('Impossible')
else:
print('Possible')
for i in range(1,idx):
print(i)
for i in range(N-1,idx,-1):
print(... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
0,
13,
13,
3,
14,
2,
13,
17,
4,
13,
... | [
[
95,
2
],
[
95,
11
],
[
98,
13
],
[
89,
25
],
[
29,
28
],
[
96,
32
],
[
99,
38
],
[
28,
39
],
[
99,
41
],
[
28,
43
],
[
87,
45
],
[
92,
47
],
[
28,
48
],
[
... | [
"n, k = map(int,input().split())\na = list(map(int,input().split()))\nidx = -1\nfor i in range(n-1):\n if a[i]+a[i+1]>=k:\n idx = i\n break\nif idx == -1:\n print('Impossible')\n exit()\nelse:\n print('Possible')\n for i in range(1, idx+1):\n print(i)\n for i in range(n-1, idx... | n, k = map(int,input().split())
a = list(map(int,input().split()))
idx = -1
for i in range(n-1):
if a[i]+a[i+1]>=k:
idx = i
break
if idx == -1:
print('Impossible')
exit()
else:
print('Possible')
for i in range(1, idx+1):
print(i)
for i in range(n-1, idx, -1):
prin... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
2,
18,
13,
17,
18,
13,
17,
0,
13,
2,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
0,
13,
2,
18,
13,
2,
13,
17,
18,
13,
... | [
[
118,
2
],
[
118,
11
],
[
109,
13
],
[
115,
25
],
[
110,
28
],
[
110,
31
],
[
115,
34
],
[
106,
37
],
[
41,
40
],
[
119,
44
],
[
121,
47
],
[
110,
50
],
[
40,
52
... | [
"N, L = map(int, input().split())\nA = list(map(int, input().split()))\nl = max_2 = A[0] + A[1]\nidx = 0\nfor i in range(N-2):\n l += A[i+2] - A[i]\n if l > max_2:\n max_2 = l\n idx = i + 1\n\nif max_2 < L:\n print('Impossible')\nelse:\n print('Possible')\n for i in range(1, idx + 1):\n print(i)\n fo... | N, L = map(int, input().split())
A = list(map(int, input().split()))
l = max_2 = A[0] + A[1]
idx = 0
for i in range(N-2):
l += A[i+2] - A[i]
if l > max_2:
max_2 = l
idx = i + 1
if max_2 < L:
print('Impossible')
else:
print('Possible')
for i in range(1, idx + 1):
print(i)
for i in range(N-1, idx... |
[
7,
15,
13,
0,
13,
18,
18,
13,
13,
13,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
39,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
4,... | [
[
113,
4
],
[
107,
11
],
[
114,
18
],
[
107,
20
],
[
104,
22
],
[
114,
31
],
[
110,
34
],
[
38,
37
],
[
102,
41
],
[
105,
47
],
[
37,
48
],
[
105,
50
],
[
37,
52
... | [
"import sys\ninput = sys.stdin.readline\nN, L = map(int, input().split())\na = list(map(int, input().split()))\nres = []\nfor i in range(N - 1):\n if a[i] + a[i + 1] >= L:\n res.append(i)\n break\nelse:\n print(\"Impossible\")\n exit(0)\nfor i in range(res[0] - 1, -1, -1): res.append(i)\nfor i in range(res... | import sys
input = sys.stdin.readline
N, L = map(int, input().split())
a = list(map(int, input().split()))
res = []
for i in range(N - 1):
if a[i] + a[i + 1] >= L:
res.append(i)
break
else:
print("Impossible")
exit(0)
for i in range(res[0] - 1, -1, -1): res.append(i)
for i in range(res[0] + 1, N - 1): res... |
[
7,
15,
13,
13,
13,
13,
13,
13,
13,
13,
13,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
2,
39,
17,
2,
13,
17,
28,
13,
4,
13,
2,
13,
17,
0,
18,
13,
13,
2,
18,
13,
13,
18... | [
[
128,
12
],
[
128,
21
],
[
107,
23
],
[
125,
33
],
[
117,
38
],
[
42,
41
],
[
117,
45
],
[
51,
48
],
[
126,
49
],
[
41,
50
],
[
108,
53
],
[
41,
54
],
[
108,
56
... | [
"# -*- coding: utf-8 -*-\nimport sys,copy,math,heapq,itertools as it,fractions,re,bisect,collections as coll\n\nN, L = map(int, raw_input().split())\na = map(int, raw_input().split())\nb = [0]*(N - 1)\nfor i in xrange(N - 1):\n b[i] = a[i] + a[i + 1]\n\nmx, idx = 0, 0\nfor i, bi in enumerate(b):\n if bi > mx:... | # -*- coding: utf-8 -*-
import sys,copy,math,heapq,itertools as it,fractions,re,bisect,collections as coll
N, L = map(int, raw_input().split())
a = map(int, raw_input().split())
b = [0]*(N - 1)
for i in xrange(N - 1):
b[i] = a[i] + a[i + 1]
mx, idx = 0, 0
for i, bi in enumerate(b):
if bi > mx:
mx = bi... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
0,
13,
2,
13,
17,
3,
4,
13,
17,
4,
... | [
[
98,
2
],
[
98,
11
],
[
101,
13
],
[
89,
25
],
[
29,
28
],
[
96,
32
],
[
102,
38
],
[
28,
39
],
[
102,
41
],
[
28,
43
],
[
99,
45
],
[
92,
47
],
[
28,
49
],
[
... | [
"N, L = map(int, input().split())\na = list(map(int, input().split()))\nend = 0\nfor i in range(N - 1):\n if a[i] + a[i + 1] >= L:\n end = i + 1\n break\nelse:\n print('Impossible')\n exit()\n\nans = list(range(1, end)) + list(range(end, N))[::-1]\nprint('Possible')\nprint(*ans, sep='\\n')",
... | N, L = map(int, input().split())
a = list(map(int, input().split()))
end = 0
for i in range(N - 1):
if a[i] + a[i + 1] >= L:
end = i + 1
break
else:
print('Impossible')
exit()
ans = list(range(1, end)) + list(range(end, N))[::-1]
print('Possible')
print(*ans, sep='\n') |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
17,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
0,
13,
13,
3,
14,
2,
13,
17,
4,
... | [
[
98,
2
],
[
98,
11
],
[
101,
13
],
[
89,
25
],
[
29,
28
],
[
99,
33
],
[
102,
39
],
[
28,
40
],
[
102,
42
],
[
28,
44
],
[
93,
46
],
[
95,
48
],
[
28,
49
],
[
... | [
"N,L=map(int,input().split())\na=list(map(int,input().split()))\n\nx=-1\nfor i in range(0,N-1):\n if a[i]+a[i+1]>=L:\n x=i\n break\nif x==-1:\n print(\"Impossible\")\nelse:\n print(\"Possible\")\n for i in range(N-1, x+1,-1):\n print(i)\n for i in range(0,x+1):\n print(i+1... | N,L=map(int,input().split())
a=list(map(int,input().split()))
x=-1
for i in range(0,N-1):
if a[i]+a[i+1]>=L:
x=i
break
if x==-1:
print("Impossible")
else:
print("Possible")
for i in range(N-1, x+1,-1):
print(i)
for i in range(0,x+1):
print(i+1) |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
4,
13,
17,
28,
13,
4,
13,
2,
13,
17,... | [
[
83,
2
],
[
83,
11
],
[
15,
14
],
[
14,
23
],
[
86,
25
],
[
29,
28
],
[
81,
32
],
[
87,
38
],
[
28,
39
],
[
87,
41
],
[
28,
43
],
[
84,
45
],
[
51,
50
],
[
... | [
"n,l = map(int,input().split())\na = [int(i) for i in input().split()]\nfor i in range(n-1):\n if a[i]+a[i+1] >= l:\n print('Possible')\n for j in range(n-1,i+1,-1):\n print(j)\n for k in range(1,i+2):\n print(k)\n exit()\nprint('Impossible')",
"n,l = map(int,input().split())",
"n",
"ma... | n,l = map(int,input().split())
a = [int(i) for i in input().split()]
for i in range(n-1):
if a[i]+a[i+1] >= l:
print('Possible')
for j in range(n-1,i+1,-1):
print(j)
for k in range(1,i+2):
print(k)
exit()
print('Impossible') |
[
7,
15,
13,
13,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
12,
13,
12,
13,
12,
13,
12,
13,
41,
28,
13,
4,
13,
13,
4,
4,
13,
12,
13,
23,
13,
4,
18,
13,
13,
2,
17,
17,
0,
13,
4,
13,
17,
0,
13,
2,
2,
17,
17,
17,
0,
... | [
[
25,
24
],
[
131,
30
],
[
34,
34
],
[
133,
43
],
[
118,
48
],
[
148,
55
],
[
131,
57
],
[
148,
58
],
[
142,
60
],
[
128,
62
],
[
65,
64
],
[
122,
68
],
[
143,
74
... | [
"import sys, re\nfrom collections import deque, defaultdict, Counter\nfrom math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians\nfrom itertools import accumulate, permutations, combinations, product\nfrom operator import itemgetter, mul\nfrom copy import deepcopy\nfrom string import ascii_lowercase, asci... | import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
18,
13,
17,
0,
13,
17,
28,
13,
13,
4,
13,
18,
13,
39,
17,
14,
40,
2,
13,
13,
13,
0,
13,
17,
3,
0,
13,
13,
14,
40,... | [
[
100,
2
],
[
100,
11
],
[
103,
13
],
[
109,
25
],
[
104,
27
],
[
106,
30
],
[
104,
38
],
[
110,
44
],
[
113,
44
],
[
95,
46
],
[
97,
48
],
[
112,
52
],
[
98,
56
... | [
"n, l = map(int, input().split())\nalist = list(map(int, input().split()))\n\npreva = alist[0]\nis_possible = False\nfor i, a in enumerate(alist[1:]):\n if preva + a >= l:\n is_possible = True\n break\n preva = a\n\nif not is_possible:\n print('Impossible')\nelse:\n print('Possible')\n for j in range(1, ... | n, l = map(int, input().split())
alist = list(map(int, input().split()))
preva = alist[0]
is_possible = False
for i, a in enumerate(alist[1:]):
if preva + a >= l:
is_possible = True
break
preva = a
if not is_possible:
print('Impossible')
else:
print('Possible')
for j in range(1, i+1):
print(j)
... |
[
7,
15,
13,
0,
13,
18,
18,
13,
13,
13,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
0,... | [
[
114,
4
],
[
108,
11
],
[
115,
18
],
[
108,
20
],
[
105,
22
],
[
115,
31
],
[
111,
34
],
[
38,
37
],
[
100,
41
],
[
106,
47
],
[
37,
48
],
[
106,
50
],
[
37,
52
... | [
"import sys\ninput=sys.stdin.readline\n\nn,l=map(int,input().split())\na=list(map(int,input().split()))\n\nx=-1\nfor i in range(n-1):\n if a[i]+a[i+1]>=l:\n x=i\n break\n\nif x==-1:\n print('Impossible')\nelse:\n print('Possible')\n for i in range(x):\n print(i+1)\n for i in rang... | import sys
input=sys.stdin.readline
n,l=map(int,input().split())
a=list(map(int,input().split()))
x=-1
for i in range(n-1):
if a[i]+a[i+1]>=l:
x=i
break
if x==-1:
print('Impossible')
else:
print('Possible')
for i in range(x):
print(i+1)
for i in range(n-2,x,-1):
pr... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
17,
13,
14,
40,
2,
18,
13,
2,
13,
17,
18,
13,
13,
13,
0,
13,
13,
3,
14,
2,
13,
17,
4,
13,
17,
... | [
[
97,
2
],
[
97,
11
],
[
85,
13
],
[
94,
25
],
[
29,
28
],
[
89,
32
],
[
86,
37
],
[
28,
39
],
[
86,
42
],
[
28,
43
],
[
98,
44
],
[
91,
46
],
[
28,
47
],
[
... | [
"N, L = map(int, input().split())\nAs = list(map(int, input().split()))\nn = -1\nfor i in range(1, N):\n if As[i-1]+As[i] >= L:\n n = i\n break\n#print(n)\nif n < 0:\n print(\"Impossible\")\n exit()\nprint(\"Possible\")\nfor i in range(n-1):\n print(i+1)\nfor i in reversed(range(n, N)):\n print(i)",
"N... | N, L = map(int, input().split())
As = list(map(int, input().split()))
n = -1
for i in range(1, N):
if As[i-1]+As[i] >= L:
n = i
break
#print(n)
if n < 0:
print("Impossible")
exit()
print("Possible")
for i in range(n-1):
print(i+1)
for i in reversed(range(n, N)):
print(i)
|
[
7,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
4,
13,
17,
0,
13,
13,
3,
4,
13,
17,
4,
... | [
[
131,
2
],
[
131,
13
],
[
122,
15
],
[
28,
27
],
[
132,
31
],
[
123,
37
],
[
27,
38
],
[
123,
40
],
[
27,
42
],
[
120,
44
],
[
128,
49
],
[
27,
50
],
[
125,
58
]... | [
"N,L=list(map(int, input().split()))\nA=list(map(int, input().split()))\nfor i in range(N-1):\n if A[i]+A[i+1]>=L:\n print('Possible')\n k=i\n break\nelse:\n print('Impossible')\n exit()\nans=[0]*(N-1)\nans[k]=N-1\nfor i in range(k):\n ans[i]=i+1\nfor i in range(N-2-k):\n ans[N-i-2]=k+i+1\nfor i in ra... | N,L=list(map(int, input().split()))
A=list(map(int, input().split()))
for i in range(N-1):
if A[i]+A[i+1]>=L:
print('Possible')
k=i
break
else:
print('Impossible')
exit()
ans=[0]*(N-1)
ans[k]=N-1
for i in range(k):
ans[i]=i+1
for i in range(N-2-k):
ans[N-i-2]=k+i+1
for i in range(N-1):
print(ans... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
0,
13,
17,
13,
17,
28,
13,
4,
13,
13,
14,
40,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
0,... | [
[
134,
2
],
[
134,
11
],
[
122,
13
],
[
131,
25
],
[
116,
28
],
[
113,
30
],
[
34,
33
],
[
108,
36
],
[
33,
39
],
[
108,
41
],
[
123,
47
],
[
33,
48
],
[
123,
50
... | [
"N,L = map(int,input().split())\nA = list(map(int,input().split()))\n\n#(方針)ロープの和がある2か所でL以上ならPossible,それ以外ならImposible\n#→Possibleな理由はその2か所以外から1つずつほどいていけば必ずL以上の部分ができるから\n#→端からほどくとわかりやすい(?)\n#→両端から行かないとL以上の部分が存在しなくなることがある\n\njudge = 0\np1,p2 = -1,-1 #2か所で和がL以上になるところ\nfor i in range(N):\n if(i != N-1):\n if(A[i]+A... | N,L = map(int,input().split())
A = list(map(int,input().split()))
#(方針)ロープの和がある2か所でL以上ならPossible,それ以外ならImposible
#→Possibleな理由はその2か所以外から1つずつほどいていけば必ずL以上の部分ができるから
#→端からほどくとわかりやすい(?)
#→両端から行かないとL以上の部分が存在しなくなることがある
judge = 0
p1,p2 = -1,-1 #2か所で和がL以上になるところ
for i in range(N):
if(i != N-1):
if(A[i]+A[i+1] >= L):
... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
0,
13,
17,
28,
13,
4,
13,
17,
2,
13,
17,
14,
40,
13,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
0,
13,
2,
... | [
[
143,
2
],
[
143,
11
],
[
134,
13
],
[
140,
25
],
[
146,
28
],
[
32,
31
],
[
129,
36
],
[
147,
40
],
[
126,
40
],
[
135,
45
],
[
31,
46
],
[
135,
48
],
[
31,
50
... | [
"n,l=map(int,input().split())\na=list(map(int,input().split()))\ncnt=0\nflag=False\nfor i in range(0,n-1):\n if not flag:\n if a[i]+a[i+1]>=l:\n cnt=i+1\n flag=True\n\nif not flag:\n print(\"Impossible\")\n exit()\n\nans=[cnt]\n\nfor i in range(cnt-1,0,-1):\n ans.append(i)\n... | n,l=map(int,input().split())
a=list(map(int,input().split()))
cnt=0
flag=False
for i in range(0,n-1):
if not flag:
if a[i]+a[i+1]>=l:
cnt=i+1
flag=True
if not flag:
print("Impossible")
exit()
ans=[cnt]
for i in range(cnt-1,0,-1):
ans.append(i)
for i in range(cnt+1,n):
... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
0,
13,
13,
3,
14,
2,
13,
17,
4,
13,
... | [
[
107,
2
],
[
107,
11
],
[
101,
13
],
[
95,
25
],
[
29,
28
],
[
105,
32
],
[
102,
38
],
[
28,
39
],
[
102,
41
],
[
28,
43
],
[
108,
45
],
[
110,
47
],
[
28,
48
],... | [
"N,L=map(int,input().split())\nA=list(map(int,input().split()))\nx=-1\nfor i in range(N-1):\n if A[i]+A[i+1]>=L:\n x=i\n break\nif x==-1:\n print('Impossible')\nelse:\n print('Possible')\n r=list(range(1,x+1))+list(range(N-1,x+1,-1))+[x+1,]\n print(*r,sep='\\n')",
"N,L=map(int,input()... | N,L=map(int,input().split())
A=list(map(int,input().split()))
x=-1
for i in range(N-1):
if A[i]+A[i+1]>=L:
x=i
break
if x==-1:
print('Impossible')
else:
print('Possible')
r=list(range(1,x+1))+list(range(N-1,x+1,-1))+[x+1,]
print(*r,sep='\n') |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
28,
13,
39,
13,
13,
4,
13,
4,
13,
13,
18,
13,
39,
17,
14,
40,
2,
13,
13,
13,
4,
13,
17,
28,
13,
4,
13,
17,
2,
13,
17,
28... | [
[
73,
2
],
[
73,
11
],
[
76,
13
],
[
77,
33
],
[
77,
35
],
[
74,
43
],
[
49,
48
],
[
57,
56
],
[
71,
60
],
[
73,
71
],
[
73,
74
],
[
76,
77
]
] | [
"N,L = map(int,input().split())\nsrc = list(map(int,input().split()))\n\nfor i,(a,b) in enumerate(zip(src, src[1:])):\n if a+b >= L:\n print('Possible')\n for j in range(1,i+1): print(j)\n for j in range(N-1,i,-1): print(j)\n exit()\nprint('Impossible')",
"N,L = map(int,input().spli... | N,L = map(int,input().split())
src = list(map(int,input().split()))
for i,(a,b) in enumerate(zip(src, src[1:])):
if a+b >= L:
print('Possible')
for j in range(1,i+1): print(j)
for j in range(N-1,i,-1): print(j)
exit()
print('Impossible')
|
[
7,
12,
13,
15,
13,
0,
13,
18,
18,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
18,
4,
13,
13,
17,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
18,
4,
13,
13,
17,
13,
28,
13,
4,
13,
17,
13,
14,
40,
2,
18,
13... | [
[
7,
6
],
[
14,
13
],
[
6,
24
],
[
14,
28
],
[
31,
30
],
[
6,
41
],
[
47,
46
],
[
13,
50
],
[
30,
55
],
[
46,
56
],
[
30,
58
],
[
46,
60
],
[
28,
62
],
[
68... | [
"def slove():\n import sys\n input = sys.stdin.readline\n n, l = list(map(int, input().rstrip('\\n').split()))\n a = list(map(int, input().rstrip('\\n').split()))\n for i in range(1, n):\n if a[i] + a[i-1] >= l:\n print(\"Possible\")\n for j in range(n-1, i, -1):\n ... | def slove():
import sys
input = sys.stdin.readline
n, l = list(map(int, input().rstrip('\n').split()))
a = list(map(int, input().rstrip('\n').split()))
for i in range(1, n):
if a[i] + a[i-1] >= l:
print("Possible")
for j in range(n-1, i, -1):
print(j)
... |
[
7,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
0,
13,... | [
[
4,
3
],
[
3,
12
],
[
103,
14
],
[
103,
16
],
[
20,
19
],
[
19,
28
],
[
94,
30
],
[
100,
33
],
[
37,
36
],
[
104,
40
],
[
95,
46
],
[
36,
47
],
[
95,
49
],
[
... | [
"n,l = [int(i) for i in input().split()]\na = [int(i) for i in input().split()]\n\nindex = 0\nfor i in range(n-1):\n if a[i]+a[i+1] >= l:\n index = i+1\n\nif index==0:\n print(\"Impossible\")\nelse:\n print(\"Possible\")\n for i in range(1,index):\n print(i)\n for i in range(n-1,index,-... | n,l = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
index = 0
for i in range(n-1):
if a[i]+a[i+1] >= l:
index = i+1
if index==0:
print("Impossible")
else:
print("Possible")
for i in range(1,index):
print(i)
for i in range(n-1,index,-1):
print(i)
... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
4,
13,
17,
4,
13,
31,
2,
4,
13,
4,
13,
17,
2,
... | [
[
89,
2
],
[
89,
11
],
[
86,
13
],
[
26,
25
],
[
84,
29
],
[
87,
35
],
[
25,
36
],
[
87,
38
],
[
25,
40
],
[
90,
42
],
[
25,
56
],
[
84,
63
],
[
25,
66
],
[
... | [
"n,l=map(int,input().split())\nt=list(map(int,input().split()))\nfor i in range(n-1):\n if t[i]+t[i+1]>=l:\n print('Possible')\n print(*(list(range(1,i+1))+list(range(n-1,i+1,-1))),sep='\\n')\n print(i+1)\n exit()\nprint('Impossible')",
"n,l=map(int,input().split())",
"n",
"map(... | n,l=map(int,input().split())
t=list(map(int,input().split()))
for i in range(n-1):
if t[i]+t[i+1]>=l:
print('Possible')
print(*(list(range(1,i+1))+list(range(n-1,i+1,-1))),sep='\n')
print(i+1)
exit()
print('Impossible') |
[
7,
0,
13,
4,
13,
0,
13,
4,
18,
4,
18,
4,
18,
17,
13,
13,
13,
17,
13,
17,
0,
13,
4,
13,
18,
13,
17,
0,
13,
4,
13,
18,
13,
17,
0,
13,
4,
13,
0,
13,
4,
18,
4,
18,
17,
13,
13,
13,
17,
28,
13,
4,
13,
2,
13,
17,
... | [
[
147,
2
],
[
150,
6
],
[
148,
15
],
[
141,
21
],
[
151,
25
],
[
148,
25
],
[
144,
28
],
[
151,
32
],
[
148,
32
],
[
159,
35
],
[
153,
39
],
[
160,
46
],
[
51,
50
... | [
"NL = input()\nNL = \"\".join(NL).rstrip(\"\\n\").split(\" \")\nN = int(NL[0])\nL = int(NL[1])\na = input()\na = \"\".join(a).split(\" \")\n\nfor s in range(N-1):\n\tif int(a[s])+int(a[s+1])>=L:\n\t\tLast = s+1\n\t\tprint(\"Possible\")\n\t\tfor s in range(N-1):\n\t\t\tif s+1>Last:\n\t\t\t\tfor j in range(N):\n\t\t\... | NL = input()
NL = "".join(NL).rstrip("\n").split(" ")
N = int(NL[0])
L = int(NL[1])
a = input()
a = "".join(a).split(" ")
for s in range(N-1):
if int(a[s])+int(a[s+1])>=L:
Last = s+1
print("Possible")
for s in range(N-1):
if s+1>Last:
for j in range(N):
if (N-1-j) ==s:
#print(Last)
break... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
4,
13,
13,
0,
13,
39,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
0,
13,
... | [
[
112,
2
],
[
112,
11
],
[
100,
13
],
[
94,
25
],
[
101,
28
],
[
106,
30
],
[
97,
33
],
[
37,
36
],
[
104,
40
],
[
101,
46
],
[
36,
47
],
[
101,
49
],
[
36,
51
],... | [
"N,L=map(int,input().split())\nA=list(map(int,input().split()))\nsum_A=sum(A)\n\njunban=[]\nflg=False\n\nfor i in range(N-1):\n if A[i]+A[i+1]>=L:\n tmp=i\n flg=True\n\n\nif flg:\n print(\"Possible\")\n for i in range(N-1):\n if tmp>i:\n print(i+1)\n else:\n ... | N,L=map(int,input().split())
A=list(map(int,input().split()))
sum_A=sum(A)
junban=[]
flg=False
for i in range(N-1):
if A[i]+A[i+1]>=L:
tmp=i
flg=True
if flg:
print("Possible")
for i in range(N-1):
if tmp>i:
print(i+1)
else:
print(N+tmp-i-1)
else:
... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
0,
13,
17,
0,
13,
2,
13,
... | [
[
109,
2
],
[
109,
11
],
[
106,
13
],
[
94,
25
],
[
97,
28
],
[
32,
31
],
[
104,
35
],
[
107,
41
],
[
31,
42
],
[
107,
44
],
[
31,
46
],
[
110,
48
],
[
115,
50
],... | [
"N,L = map(int,input().split())\nA = list(map(int,input().split()))\n\nuntiable = False\nlastknot = None\n\nfor i in range(N-1):\n if A[i]+A[i+1] >= L:\n untiable = True\n lastknot = i+1\n break\n\nif untiable:\n ans = [i for i in range(1,lastknot)] + [i for i in range(lastknot+1,N)[::-1]... | N,L = map(int,input().split())
A = list(map(int,input().split()))
untiable = False
lastknot = None
for i in range(N-1):
if A[i]+A[i+1] >= L:
untiable = True
lastknot = i+1
break
if untiable:
ans = [i for i in range(1,lastknot)] + [i for i in range(lastknot+1,N)[::-1]] + [lastknot]
... |
[
7,
15,
13,
0,
13,
4,
13,
13,
4,
18,
4,
18,
18,
13,
13,
13,
13,
13,
0,
13,
4,
13,
13,
4,
18,
4,
18,
18,
13,
13,
13,
13,
0,
13,
4,
13,
13,
0,
13,
39,
0,
13,
17,
0,
13,
2,
13,
17,
28,
13,
4,
13,
2,
13,
17,
14,... | [
[
139,
4
],
[
139,
17
],
[
157,
19
],
[
133,
33
],
[
158,
36
],
[
127,
38
],
[
148,
41
],
[
151,
44
],
[
140,
46
],
[
50,
49
],
[
140,
53
],
[
134,
57
],
[
137,
57
... | [
"import sys\n\nN, L = map(int, sys.stdin.readline().split())\nAs = map(int, sys.stdin.readline().split())\n\ntot = sum(As)\n\nres = []\n\na = 0\nb = N-1\nfor _ in range(N-1):\n if tot < L:\n print \"Impossible\"\n sys.exit()\n\n na = As[a] + As[a+1]\n nb = As[b] + As[b-1]\n\n if na < nb:\n... | import sys
N, L = map(int, sys.stdin.readline().split())
As = map(int, sys.stdin.readline().split())
tot = sum(As)
res = []
a = 0
b = N-1
for _ in range(N-1):
if tot < L:
print "Impossible"
sys.exit()
na = As[a] + As[a+1]
nb = As[b] + As[b-1]
if na < nb:
#tot -= na
... |
[
7,
15,
13,
6,
13,
12,
13,
29,
4,
13,
0,
13,
13,
13,
12,
13,
0,
13,
4,
18,
13,
13,
17,
13,
0,
13,
4,
18,
13,
13,
13,
29,
39,
13,
13,
0,
13,
13,
13,
12,
13,
29,
4,
18,
4,
18,
13,
13,
13,
0,
13,
13,
13,
12,
13,
... | [
[
13,
6
],
[
13,
11
],
[
13,
13
],
[
38,
15
],
[
18,
17
],
[
18,
23
],
[
26,
25
],
[
17,
30
],
[
38,
36
],
[
38,
38
],
[
52,
40
],
[
13,
47
],
[
52,
50
],
[
... | [
"import re\n\nclass IO_for_Contest(object):\n @staticmethod\n def my_input():\n #return raw_input()\n return input()\n\n @staticmethod\n def read_from_input():\n n, l = IO_for_Contest.read_n_int(2)\n a = IO_for_Contest.read_n_int(n)\n return l, a\n\n @staticmethod\n... | import re
class IO_for_Contest(object):
@staticmethod
def my_input():
#return raw_input()
return input()
@staticmethod
def read_from_input():
n, l = IO_for_Contest.read_n_int(2)
a = IO_for_Contest.read_n_int(n)
return l, a
@staticmethod
def read_line():... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
14,
2,
13,
17,
14,
40,
4,
13,
13,
13,
4,
13,
17,
4,
13,
17,
4,
13,
4,
13,
17,
4,
13,
0,
13,
39,
28,
13,
4,
13,
2,
13,
... | [
[
140,
2
],
[
140,
11
],
[
137,
13
],
[
141,
26
],
[
138,
32
],
[
135,
33
],
[
143,
48
],
[
52,
51
],
[
141,
55
],
[
138,
61
],
[
51,
62
],
[
138,
64
],
[
51,
66
... | [
"N,L=map(int,input().split())\nA=list(map(int,input().split()))\n\nif N==2:\n if sum(A)>=L:\n print(\"Possible\")\n print(\"1\")\n exit()\n else:\n print(\"Impossible\")\n exit()\nans=[]\nfor i in range(N-1):\n if A[i]+A[i+1]>=L:\n last=i\n for j in range(i)... | N,L=map(int,input().split())
A=list(map(int,input().split()))
if N==2:
if sum(A)>=L:
print("Possible")
print("1")
exit()
else:
print("Impossible")
exit()
ans=[]
for i in range(N-1):
if A[i]+A[i+1]>=L:
last=i
for j in range(i):
ans.append(j... |
[
7,
15,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
28,
13,
4,
13,
2,
4,
13,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
0,
13,
2,
13,
17,
3,
4,
13,
17,
4,
... | [
[
96,
3
],
[
96,
12
],
[
87,
14
],
[
27,
26
],
[
88,
32
],
[
88,
38
],
[
26,
39
],
[
88,
41
],
[
26,
43
],
[
91,
45
],
[
93,
47
],
[
26,
49
],
[
62,
61
],
[
... | [
"from collections import deque\nN, L = map(int, input().split())\nc = list(map(int, input().split()))\nfor i in range(len(c)-1):\n if c[i] + c[i+1] >= L:\n pos = i + 1\n break\nelse:\n print(\"Impossible\")\n exit()\n\nprint(\"Possible\")\nfor i in range(1,pos):\n print(i)\nfor i in range(len(c) -1, pos, ... | from collections import deque
N, L = map(int, input().split())
c = list(map(int, input().split()))
for i in range(len(c)-1):
if c[i] + c[i+1] >= L:
pos = i + 1
break
else:
print("Impossible")
exit()
print("Possible")
for i in range(1,pos):
print(i)
for i in range(len(c) -1, pos, -1):
print(i)
print(p... |
[
7,
12,
13,
0,
13,
4,
13,
13,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
0,
13,
13,
3,
29,
17,
0,
13,
2,
2,
4,
13,
4,
13,
13,
4,
13,
4,
13,
4,
13,
2,
13,
17,
2,
13,
17,
39,
13,
... | [
[
5,
4
],
[
59,
7
],
[
10,
9
],
[
4,
13
],
[
59,
19
],
[
9,
20
],
[
59,
22
],
[
9,
24
],
[
61,
26
],
[
29,
28
],
[
9,
29
],
[
35,
34
],
[
4,
52
],
[
34,
... | [
"def solve(A,L):\n N = len(A)\n for i in range(N-1):\n if A[i]+A[i+1] >= L:\n pro = i\n break\n else:\n return None\n\n res = list(range(i))+list(reversed(range(i+1,N-1)))+[i]\n return res\n\n\nif __name__ == '__main__':\n N,L = map(int,input().split())\n\n A... | def solve(A,L):
N = len(A)
for i in range(N-1):
if A[i]+A[i+1] >= L:
pro = i
break
else:
return None
res = list(range(i))+list(reversed(range(i+1,N-1)))+[i]
return res
if __name__ == '__main__':
N,L = map(int,input().split())
A = list(map(int,input... |
[
7,
12,
13,
29,
4,
13,
4,
13,
12,
13,
29,
4,
13,
13,
4,
18,
4,
13,
13,
12,
13,
29,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
12,
13,
41,
28,
13,
4,
13,
13,
4,
4,
13,
4,
13,
29,
13,
23,
13,
12,
13,
29,
4,
18,
4,
18... | [
[
37,
36
],
[
48,
39
],
[
48,
48
],
[
71,
68
],
[
73,
69
],
[
71,
71
],
[
73,
73
],
[
79,
78
],
[
96,
81
],
[
92,
87
],
[
94,
88
],
[
92,
92
],
[
94,
94
],
[
... | [
"def getN():\n return int(input())\ndef getNM():\n return map(int, input().split())\ndef getList():\n return list(map(int, input().split()))\ndef getArray(intn):\n return [int(input()) for i in range(intn)]\ndef input():\n return sys.stdin.readline().rstrip()\ndef rand_N(ran1, ran2):\n return rand... | def getN():
return int(input())
def getNM():
return map(int, input().split())
def getList():
return list(map(int, input().split()))
def getArray(intn):
return [int(input()) for i in range(intn)]
def input():
return sys.stdin.readline().rstrip()
def rand_N(ran1, ran2):
return random.randint(ran1,... |
[
7,
15,
0,
13,
12,
4,
18,
13,
13,
4,
13,
13,
23,
0,
13,
12,
4,
13,
4,
13,
0,
13,
12,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
12,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
12,
4,
18,
4,
13,
13,
0,
13,
17,
0,
1... | [
[
137,
3
],
[
164,
14
],
[
167,
21
],
[
143,
34
],
[
146,
45
],
[
140,
53
],
[
158,
56
],
[
170,
59
],
[
73,
71
],
[
73,
73
],
[
155,
75
],
[
144,
77
],
[
155,
78
... | [
"from sys import stdout\nprintn = lambda x: stdout.write(str(x))\ninn = lambda : int(input())\ninl = lambda: list(map(int, input().split()))\ninm = lambda: map(int, input().split())\nins = lambda : input().strip()\nDBG = True # and False\nBIG = 999999999\nR = 10**9 + 7\n\ndef ddprint(x):\n if DBG:\n pr... | from sys import stdout
printn = lambda x: stdout.write(str(x))
inn = lambda : int(input())
inl = lambda: list(map(int, input().split()))
inm = lambda: map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 999999999
R = 10**9 + 7
def ddprint(x):
if DBG:
print(x)
n,l = inm... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
41,
28,
13,
4,
13,
2,
13,
17,
4,
2,
18,
13,
13,
18,
13,
2,
13,
17,
0,
13,
13,
0,
13,
4,
13,
4,
13,
13,
0,
13,
12,
18,
... | [
[
108,
2
],
[
108,
11
],
[
111,
13
],
[
27,
26
],
[
109,
30
],
[
112,
35
],
[
26,
36
],
[
112,
38
],
[
26,
40
],
[
99,
43
],
[
102,
46
],
[
100,
51
],
[
54,
53
],... | [
"#!/usr/bin/env python3\n\nN, L = map(int, input().split())\na = list(map(int, input().split()))\n\nsums = [a[i]+a[i+1] for i in range(N-1)]\n\nmaxind, maxval = max(enumerate(sums), key=lambda x:x[1])\nif maxval >= L:\n print(\"Possible\")\n for i in range(maxind):\n print(i+1)\n for j in reversed(r... | #!/usr/bin/env python3
N, L = map(int, input().split())
a = list(map(int, input().split()))
sums = [a[i]+a[i+1] for i in range(N-1)]
maxind, maxval = max(enumerate(sums), key=lambda x:x[1])
if maxval >= L:
print("Possible")
for i in range(maxind):
print(i+1)
for j in reversed(range(maxind, N-1)):... |
[
7,
15,
12,
13,
17,
0,
13,
4,
13,
13,
13,
4,
13,
13,
17,
29,
4,
13,
13,
13,
23,
13,
12,
13,
28,
13,
13,
4,
13,
4,
13,
13,
17,
14,
40,
4,
13,
13,
13,
3,
29,
39,
0,
13,
39,
28,
13,
4,
13,
17,
13,
4,
18,
13,
13,
... | [
[
7,
6
],
[
21,
9
],
[
7,
10
],
[
10,
13
],
[
6,
18
],
[
10,
19
],
[
21,
21
],
[
137,
30
],
[
79,
31
],
[
77,
38
],
[
44,
43
],
[
47,
46
],
[
43,
53
],
[
46... | [
"# 解説見た\n\nfrom itertools import tee\n\n\ndef pairwise(iterable):\n \"s -> (s0,s1), (s1,s2), (s2, s3), ...\"\n a, b = tee(iterable)\n next(b, None)\n return zip(a, b)\n\n\ndef solve(N, L, a):\n for knot, pair in enumerate(pairwise(a), 1):\n if sum(pair) >= L:\n break\n else:\n ... | # 解説見た
from itertools import tee
def pairwise(iterable):
"s -> (s0,s1), (s1,s2), (s2, s3), ..."
a, b = tee(iterable)
next(b, None)
return zip(a, b)
def solve(N, L, a):
for knot, pair in enumerate(pairwise(a), 1):
if sum(pair) >= L:
break
else:
return []
#... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
0,
13,
17,
0,
13,
13,
3,
14,
2,
13,
... | [
[
100,
2
],
[
100,
11
],
[
106,
13
],
[
103,
25
],
[
29,
28
],
[
92,
32
],
[
107,
38
],
[
28,
39
],
[
107,
41
],
[
28,
43
],
[
101,
45
],
[
94,
47
],
[
97,
50
],
... | [
"n,l=map(int,input().split())\na=list(map(int,input().split()))\nfailflag=1\nfor i in range(n-1):\n if a[i]+a[i+1]>=l:\n failflag=0\n k=i\n break\nif failflag==1:\n print('Impossible')\nelse:\n print('Possible')\n for i in range(1,k+1):\n print(i)\n for i in range(n-1-k):\n print(n-1-i)",
"n,l... | n,l=map(int,input().split())
a=list(map(int,input().split()))
failflag=1
for i in range(n-1):
if a[i]+a[i+1]>=l:
failflag=0
k=i
break
if failflag==1:
print('Impossible')
else:
print('Possible')
for i in range(1,k+1):
print(i)
for i in range(n-1-k):
print(n-1-i) |
[
7,
12,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
41,
28,
13,
13,
4,
13,
13,
18,
13,
39,
17,
4,
2,
13,
13,
0,
13,
13,
28,
13,
39,
13,
13,
4,
13,
4,
13,
13,... | [
[
5,
4
],
[
5,
15
],
[
18,
17
],
[
17,
34
],
[
17,
36
],
[
45,
44
],
[
17,
55
],
[
17,
57
],
[
15,
66
],
[
70,
69
],
[
69,
73
],
[
69,
75
],
[
78,
77
],
[
8... | [
"# AGC002C - Knot Puzzle\ndef main():\n N, L = tuple(map(int, input().split()))\n A = tuple(map(int, input().split()))\n B = [i + j for i, j in zip(A, A[1:])]\n for i, (a, b) in enumerate(zip(A, A[1:]), 1):\n if a + b >= L:\n ans = [i for i in range(1, i)]\n ans += [i for i ... | # AGC002C - Knot Puzzle
def main():
N, L = tuple(map(int, input().split()))
A = tuple(map(int, input().split()))
B = [i + j for i, j in zip(A, A[1:])]
for i, (a, b) in enumerate(zip(A, A[1:]), 1):
if a + b >= L:
ans = [i for i in range(1, i)]
ans += [i for i in range(N - ... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
0,
13,
17,
0,
13,
17,
28,
13,
4,
13,
17,
13,
14,
40,
2,
18,
13,
2,
13,
17,
18,
13,
13,
13,
0,
13,
17,
0,
13,... | [
[
109,
2
],
[
109,
11
],
[
15,
14
],
[
14,
23
],
[
103,
25
],
[
97,
28
],
[
112,
31
],
[
35,
34
],
[
110,
38
],
[
104,
43
],
[
34,
45
],
[
104,
48
],
[
34,
49
],
... | [
"N,L=map(int,input().split())\nA=[int(x) for x in input().split()]\n\npsbl=False\nans=0\nfor i in range(1,N):\n if A[i-1]+A[i]>=L:\n psbl=True\n ans=i-1\n break\nif psbl==False:\n print(\"Impossible\")\nelse:\n print(\"Possible\")\n for i in range(ans):\n print(i+1)\n for j in range(N-1-ans):\n ... | N,L=map(int,input().split())
A=[int(x) for x in input().split()]
psbl=False
ans=0
for i in range(1,N):
if A[i-1]+A[i]>=L:
psbl=True
ans=i-1
break
if psbl==False:
print("Impossible")
else:
print("Possible")
for i in range(ans):
print(i+1)
for j in range(N-1-ans):
print(N-j-1) |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
0,
13,
13,
3,
14,
2,
13,
17,
4,
13,
... | [
[
104,
2
],
[
104,
11
],
[
107,
13
],
[
98,
25
],
[
29,
28
],
[
105,
32
],
[
108,
38
],
[
28,
39
],
[
108,
41
],
[
28,
43
],
[
102,
45
],
[
95,
47
],
[
28,
48
],
... | [
"n, l = map(int, input().split())\na = list(map(int, input().split()))\n\npos = -1\n\nfor i in range(n-1):\n if a[i] + a[i+1] >= l:\n pos = i\n break\nif pos == -1:\n print('Impossible')\n exit()\n\nprint('Possible')\nfor i in range(pos):\n print(i+1)\n\nfor i in reversed(range(pos+1,n-1))... | n, l = map(int, input().split())
a = list(map(int, input().split()))
pos = -1
for i in range(n-1):
if a[i] + a[i+1] >= l:
pos = i
break
if pos == -1:
print('Impossible')
exit()
print('Possible')
for i in range(pos):
print(i+1)
for i in reversed(range(pos+1,n-1)):
print(i+1)
prin... |
[
7,
15,
13,
15,
13,
15,
13,
15,
13,
15,
13,
15,
13,
15,
13,
0,
13,
18,
18,
13,
13,
13,
4,
18,
13,
13,
17,
0,
13,
2,
2,
17,
17,
17,
12,
13,
12,
13,
12,
13,
41,
28,
13,
4,
13,
13,
4,
4,
13,
12,
13,
23,
13,
41,
2... | [
[
280,
16
],
[
283,
28
],
[
43,
42
],
[
308,
48
],
[
52,
52
],
[
56,
55
],
[
64,
64
],
[
66,
66
],
[
70,
69
],
[
78,
78
],
[
80,
80
],
[
82,
82
],
[
87,
86
],
[... | [
"import bisect\nimport copy\nimport heapq\nimport sys\nimport itertools\nimport math\nimport queue\ninput = sys.stdin.readline\nsys.setrecursionlimit(1000000)\nmod = 10 ** 9 + 7\n\ndef read_values(): return map(int, input().split())\ndef read_index(): return map(lambda x: int(x) - 1, input().split())\ndef read_list... | import bisect
import copy
import heapq
import sys
import itertools
import math
import queue
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
mod = 10 ** 9 + 7
def read_values(): return map(int, input().split())
def read_index(): return map(lambda x: int(x) - 1, input().split())
def read_list(): return list(re... |
[
7,
12,
13,
0,
13,
4,
13,
13,
14,
2,
13,
17,
0,
13,
17,
4,
13,
13,
29,
14,
40,
13,
17,
0,
13,
17,
0,
13,
2,
13,
13,
14,
2,
2,
13,
17,
17,
0,
13,
17,
0,
13,
17,
4,
13,
13,
29,
12,
13,
0,
13,
4,
13,
13,
0,
13,... | [
[
5,
4
],
[
5,
7
],
[
4,
10
],
[
14,
13
],
[
13,
17
],
[
7,
21
],
[
25,
24
],
[
28,
27
],
[
7,
29
],
[
4,
30
],
[
27,
34
],
[
39,
38
],
[
42,
41
],
[
41,
... | [
"def examA():\n a, b = LI()\n if a>0:\n ans = \"Positive\"\n print(ans)\n return\n if b>=0:\n ans = \"Zero\"\n else:\n judge = b-a\n if judge%2==1:\n ans = \"Positive\"\n else:\n ans = \"Negative\"\n print(ans)\n return\n\ndef ... | def examA():
a, b = LI()
if a>0:
ans = "Positive"
print(ans)
return
if b>=0:
ans = "Zero"
else:
judge = b-a
if judge%2==1:
ans = "Positive"
else:
ans = "Negative"
print(ans)
return
def examB():
N, M = LI()
b... |
[
7,
15,
15,
13,
13,
13,
13,
13,
13,
13,
13,
4,
18,
13,
13,
2,
17,
17,
0,
13,
4,
13,
17,
0,
13,
2,
2,
17,
17,
17,
0,
13,
2,
17,
17,
12,
13,
12,
13,
0,
13,
4,
13,
13,
0,
13,
4,
13,
0,
13,
17,
28,
13,
4,
13,
2,... | [
[
109,
19
],
[
124,
24
],
[
112,
31
],
[
139,
40
],
[
137,
42
],
[
139,
43
],
[
127,
45
],
[
137,
47
],
[
121,
49
],
[
53,
52
],
[
134,
56
],
[
128,
62
],
[
52,
63
... | [
"from collections import defaultdict,deque\nimport sys,heapq,bisect,math,itertools,string,queue,datetime\nsys.setrecursionlimit(10**8)\nINF = float('inf')\nmod = 10**9+7\neps = 10**-7\ndef inpl(): return list(map(int, input().split()))\ndef inpl_s(): return list(input().split())\n\nN,L = inpl()\naa = inpl()\ntmp = ... | from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, input().split()))
def inpl_s(): return list(input().split())
N,L = inpl()
aa = inpl()
tmp = 0
for i in range... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
0,
13,
13,
3,
14,
2,
13,
17,
4,
13,
... | [
[
93,
2
],
[
93,
11
],
[
96,
13
],
[
87,
25
],
[
29,
28
],
[
91,
32
],
[
97,
38
],
[
28,
39
],
[
97,
41
],
[
28,
43
],
[
94,
45
],
[
99,
47
],
[
28,
48
],
[
... | [
"n, l = map(int,input().split())\nA = list(map(int,input().split()))\n\nlast = -1\nfor i in range(n-1):\n if A[i] + A[i+1] >= l:\n last = i\n break\n\nif last == -1:\n print(\"Impossible\")\nelse:\n print(\"Possible\")\n for i in range(last):\n print(i+1)\n for i in range(n-2, la... | n, l = map(int,input().split())
A = list(map(int,input().split()))
last = -1
for i in range(n-1):
if A[i] + A[i+1] >= l:
last = i
break
if last == -1:
print("Impossible")
else:
print("Possible")
for i in range(last):
print(i+1)
for i in range(n-2, last-1, -1):
print... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
18,
4,
13,
17,
13,
13,
13,
31,
13,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
0,
13,
13,
13,
2,
13,
17,
3,
14,
13,
4,
13,
17,
28,
13,
4... | [
[
79,
2
],
[
79,
15
],
[
79,
16
],
[
73,
19
],
[
23,
22
],
[
80,
26
],
[
22,
33
],
[
22,
37
],
[
77,
39
],
[
70,
41
],
[
22,
42
],
[
82,
43
],
[
22,
45
],
[
... | [
"n, L, *a = map(int, open(0).read().split())\n\ncant = 0\nfor i in range(n-1):\n if a[i]+a[i+1]>=L:\n l, r = i, i+1\n break\nelse: cant = 1\n\nif cant: print(\"Impossible\")\nelse:\n print(\"Possible\")\n for i in range(l): print(i+1)\n for i in range(n-2, l-1, -1): print(i+1)",
"n, L, *... | n, L, *a = map(int, open(0).read().split())
cant = 0
for i in range(n-1):
if a[i]+a[i+1]>=L:
l, r = i, i+1
break
else: cant = 1
if cant: print("Impossible")
else:
print("Possible")
for i in range(l): print(i+1)
for i in range(n-2, l-1, -1): print(i+1) |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
0,
13,
39,
13,
2,
13,
17,
... | [
[
135,
2
],
[
135,
11
],
[
123,
13
],
[
126,
25
],
[
117,
28
],
[
32,
31
],
[
136,
35
],
[
124,
41
],
[
31,
42
],
[
124,
44
],
[
31,
46
],
[
115,
48
],
[
120,
50
... | [
"n,l = map(int,input().split())\narr = list(map(int,input().split()))\n\nkey = 0\nflag = False\nfor i in range(n-1):\n if arr[i] + arr[i+1] >= l:\n key = [i,i+1]\n flag = True\n break\n\n# print(key)\nif flag:\n print(\"Possible\")\n for i in range(key[0]):\n print(i+1)\n tem... | n,l = map(int,input().split())
arr = list(map(int,input().split()))
key = 0
flag = False
for i in range(n-1):
if arr[i] + arr[i+1] >= l:
key = [i,i+1]
flag = True
break
# print(key)
if flag:
print("Possible")
for i in range(key[0]):
print(i+1)
temp = []
for i in ran... |
[
7,
15,
13,
4,
18,
13,
13,
17,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
14,
2,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
... | [
[
120,
9
],
[
120,
18
],
[
123,
20
],
[
111,
32
],
[
126,
35
],
[
39,
38
],
[
121,
42
],
[
124,
48
],
[
38,
49
],
[
124,
51
],
[
38,
53
],
[
112,
55
],
[
118,
55
... | [
"import sys\nsys.setrecursionlimit(200000)\nn,l=map(int,input().split())\nr=list(map(int,input().split()))\nlast=0;tiepoint=0\nfor i in range(n-1):\n if r[i]+r[i+1]>last:\n last=r[i]+r[i+1]\n tiepoint=i\nif last>=l:\n print(\"Possible\")\n for i in range(tiepoint):\n print(i+1)\n for i in range(tiepoin... | import sys
sys.setrecursionlimit(200000)
n,l=map(int,input().split())
r=list(map(int,input().split()))
last=0;tiepoint=0
for i in range(n-1):
if r[i]+r[i+1]>last:
last=r[i]+r[i+1]
tiepoint=i
if last>=l:
print("Possible")
for i in range(tiepoint):
print(i+1)
for i in range(tiepoint+1,n-1)[::-1]:
... |
[
7,
15,
13,
0,
13,
18,
18,
18,
13,
13,
13,
13,
12,
13,
23,
13,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
1... | [
[
132,
4
],
[
15,
15
],
[
135,
17
],
[
133,
24
],
[
135,
26
],
[
129,
28
],
[
133,
37
],
[
138,
40
],
[
44,
43
],
[
136,
47
],
[
130,
53
],
[
43,
54
],
[
130,
56
... | [
"import sys\nreadline = sys.stdin.buffer.readline\ndef even(n): return 1 if n%2==0 else 0\n\nn,l = map(int,readline().split())\nlst1 = list(map(int,readline().split()))\n\nres = -1\n\nfor i in range(n-1):\n if lst1[i]+lst1[i+1] >= l:\n res = i\n\nif res == -1:\n print(\"Impossible\")\n exit()\nelse:... | import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0
n,l = map(int,readline().split())
lst1 = list(map(int,readline().split()))
res = -1
for i in range(n-1):
if lst1[i]+lst1[i+1] >= l:
res = i
if res == -1:
print("Impossible")
exit()
else:
print("Possible")
... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
18,
4,
13,
17,
13,
13,
13,
31,
13,
28,
13,
39,
13,
13,
4,
13,
4,
13,
13,
18,
13,
39,
17,
14,
40,
2,
13,
13,
13,
4,
13,
17,
0,
13,
4,
13,
4,
13,
13,
4,
13,
4,
18,
17,
13,
4,
13... | [
[
83,
2
],
[
83,
15
],
[
83,
16
],
[
81,
37
],
[
77,
42
],
[
84,
47
],
[
78,
59
],
[
78,
66
],
[
77,
78
],
[
83,
81
],
[
83,
84
]
] | [
"n,l,*a=map(int,open(0).read().split())\nfor i,(x,y) in enumerate(zip(a,a[1:])):\n\tif x+y>=l:\n\t\tprint(\"Possible\")\n\t\tr=list(range(n))\n\t\tprint(\"\\n\".join(map(str,r[1:i+1]+r[n:i:-1])))\n\t\texit()\nprint(\"Impossible\")",
"n,l,*a=map(int,open(0).read().split())",
"n",
"map(int,open(0).read().split(... | n,l,*a=map(int,open(0).read().split())
for i,(x,y) in enumerate(zip(a,a[1:])):
if x+y>=l:
print("Possible")
r=list(range(n))
print("\n".join(map(str,r[1:i+1]+r[n:i:-1])))
exit()
print("Impossible") |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
0,
13,
17,
0,
13,
2,
13,
... | [
[
109,
2
],
[
109,
11
],
[
94,
13
],
[
100,
25
],
[
103,
28
],
[
32,
31
],
[
92,
35
],
[
95,
41
],
[
31,
42
],
[
95,
44
],
[
31,
46
],
[
110,
48
],
[
97,
50
],
... | [
"n,l = map(int,input().split())\nL = list(map(int,input().split()))\nflag = False\ncur = 0\nfor i in range(n-1):\n if L[i]+L[i+1] >= l:\n flag = True\n cur = i+1\n break\nif flag:\n print('Possible')\n for i in range(1,cur):\n print(i)\n for i in range(n-1,cur,-1):\n p... | n,l = map(int,input().split())
L = list(map(int,input().split()))
flag = False
cur = 0
for i in range(n-1):
if L[i]+L[i+1] >= l:
flag = True
cur = i+1
break
if flag:
print('Possible')
for i in range(1,cur):
print(i)
for i in range(n-1,cur,-1):
print(i)
print(c... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
18,
4,
13,
17,
13,
13,
13,
31,
13,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
0,
13,
13,
14,
40,
13,
17,
4,
13,
17,
28,
13,
18,
4,
13,
... | [
[
90,
2
],
[
90,
15
],
[
90,
16
],
[
93,
19
],
[
23,
22
],
[
91,
26
],
[
22,
33
],
[
22,
37
],
[
85,
39
],
[
87,
41
],
[
22,
42
],
[
88,
45
],
[
94,
45
],
[
... | [
"N,L,*A=map(int,open(0).read().split())\nk=-1\nfor i in range(N-1):\n\tif A[i]+A[i+1]>=L:\n\t\tk=i\nif k>=0:\n\tprint('Possible')\n\tfor i in range(k+1,N-1)[::-1]:\n\t\tprint(i+1)\n\tfor i in range(k+1):\n\t\tprint(i+1)\nelse:\n\tprint('Impossible')",
"N,L,*A=map(int,open(0).read().split())",
"N",
"map(int,op... | N,L,*A=map(int,open(0).read().split())
k=-1
for i in range(N-1):
if A[i]+A[i+1]>=L:
k=i
if k>=0:
print('Possible')
for i in range(k+1,N-1)[::-1]:
print(i+1)
for i in range(k+1):
print(i+1)
else:
print('Impossible')
|
[
7,
12,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13... | [
[
6,
5
],
[
5,
14
],
[
17,
16
],
[
17,
18
],
[
22,
21
],
[
21,
30
],
[
33,
32
],
[
36,
35
],
[
39,
38
],
[
16,
42
],
[
32,
48
],
[
38,
49
],
[
32,
51
],
[
3... | [
"def main():\n N,L = [int(n) for n in input().split()]\n A = [int(n) for n in input().split()]\n flg = False\n for i in range(N-1):\n if(A[i]+A[i+1] >= L):\n flg = True\n break\n if not flg:\n print(\"Impossible\")\n return\n print(\"Possible\")\n for ... | def main():
N,L = [int(n) for n in input().split()]
A = [int(n) for n in input().split()]
flg = False
for i in range(N-1):
if(A[i]+A[i+1] >= L):
flg = True
break
if not flg:
print("Impossible")
return
print("Possible")
for j in range(1,i+1):
... |
[
7,
15,
13,
15,
13,
12,
13,
0,
13,
18,
18,
18,
13,
13,
13,
13,
0,
13,
2,
2,
17,
17,
17,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
18,
13,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
28,
13,
4,
13,... | [
[
9,
8
],
[
18,
17
],
[
25,
24
],
[
8,
33
],
[
25,
35
],
[
38,
37
],
[
8,
50
],
[
54,
53
],
[
24,
57
],
[
37,
62
],
[
53,
63
],
[
37,
65
],
[
53,
67
],
[
35... | [
"import sys\nimport collections\n\n\ndef solve():\n readline = sys.stdin.buffer.readline\n mod = 10 ** 9 + 7\n n, l = list(map(int, readline().split()))\n a = collections.deque(list(map(int, readline().split())))\n for i in range(1, n):\n if a[i] + a[i-1] >= l:\n print(\"Possible\")... | import sys
import collections
def solve():
readline = sys.stdin.buffer.readline
mod = 10 ** 9 + 7
n, l = list(map(int, readline().split()))
a = collections.deque(list(map(int, readline().split())))
for i in range(1, n):
if a[i] + a[i-1] >= l:
print("Possible")
for j... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
18,
4,
13,
17,
13,
13,
13,
31,
13,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
0,
13,
2,
13,
17,
3,
14,
2,
13,
17,
4,
13,
17,
4,
13,
17,... | [
[
88,
2
],
[
88,
15
],
[
88,
16
],
[
85,
19
],
[
23,
22
],
[
83,
26
],
[
22,
33
],
[
22,
37
],
[
89,
39
],
[
91,
41
],
[
22,
43
],
[
92,
48
],
[
86,
48
],
[
... | [
"N, L, *A = map(int, open(0).read().split())\n\nk = -1\nfor i in range(N - 1):\n if A[i] + A[i + 1] >= L:\n k = i + 1\n break\n\nif k == -1:\n print(\"Impossible\")\nelse:\n print(\"Possible\")\n for j in range(1, k):\n print(j)\n for j in reversed(range(k + 1, N)):\n prin... | N, L, *A = map(int, open(0).read().split())
k = -1
for i in range(N - 1):
if A[i] + A[i + 1] >= L:
k = i + 1
break
if k == -1:
print("Impossible")
else:
print("Possible")
for j in range(1, k):
print(j)
for j in reversed(range(k + 1, N)):
print(j)
print(k) |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
0,
13,
17,
28,
13,
4,
13,
17,
13,
0,
13,
2,
18,
13,
2,
13,
17,
18,
13,
13,
14,
40,
13,
13,
0,
13,
13,
0,
13,
... | [
[
102,
2
],
[
102,
11
],
[
96,
13
],
[
114,
25
],
[
99,
28
],
[
32,
31
],
[
94,
35
],
[
105,
37
],
[
97,
40
],
[
31,
42
],
[
97,
45
],
[
31,
46
],
[
106,
49
],
... | [
"n,l = map(int,input().split())\nr = list(map(int,input().split()))\no = 0\nflag = 1\nfor i in range(1,n):\n lr = r[i-1] +r[i]\n if lr >= l:\n o = i\n flag = 0\n break\nif flag == 0:\n print('Possible')\n for j in range(1,o):\n print(j)\n for k in range(n-1,o,-1):\n ... | n,l = map(int,input().split())
r = list(map(int,input().split()))
o = 0
flag = 1
for i in range(1,n):
lr = r[i-1] +r[i]
if lr >= l:
o = i
flag = 0
break
if flag == 0:
print('Possible')
for j in range(1,o):
print(j)
for k in range(n-1,o,-1):
print(k)
print(... |
[
7,
15,
13,
0,
13,
18,
18,
18,
13,
13,
13,
13,
0,
13,
18,
18,
18,
13,
13,
13,
13,
0,
13,
18,
18,
18,
13,
13,
13,
13,
0,
13,
12,
4,
13,
4,
13,
0,
13,
12,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
12,
4,
18,
4,
18,
... | [
[
244,
4
],
[
241,
13
],
[
217,
22
],
[
250,
31
],
[
242,
36
],
[
220,
38
],
[
242,
46
],
[
238,
49
],
[
242,
56
],
[
226,
61
],
[
242,
71
],
[
76,
75
],
[
227,
81
... | [
"import sys\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\nin_n = lambda: int(readline())\nin_nn = lambda: map(int, readline().split())\nin_s = lambda: readline().rstrip().decode('utf-8')\nin_nl = lambda: list(map(int, readline().split()))\nin_nl2 = ... | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
in_n = lambda: int(readline())
in_nn = lambda: map(int, readline().split())
in_s = lambda: readline().rstrip().decode('utf-8')
in_nl = lambda: list(map(int, readline().split()))
in_nl2 = lambda H: [in_n... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
18,
4,
13,
17,
13,
13,
13,
31,
13,
0,
13,
17,
28,
13,
13,
4,
13,
13,
18,
13,
39,
17,
4,
13,
17,
10,
4,
13,
10,
17,
13,
10,
4,
13
] | [
[
41,
2
],
[
41,
15
],
[
41,
16
],
[
38,
19
],
[
41,
36
],
[
38,
39
],
[
41,
42
]
] | [
"n,l,*a=map(int,open(0).read().split())\ni=0\nfor a,b in zip(a,a[1:]):i+=1;a+b>=l>exit(print('Possible',*range(1,i),*range(n-1,i-1,-1)))\nprint('Impossible')",
"n,l,*a=map(int,open(0).read().split())",
"n",
"map(int,open(0).read().split())",
"map",
"int",
"open(0).read().split()",
"(0).read().split",
... | n,l,*a=map(int,open(0).read().split())
i=0
for a,b in zip(a,a[1:]):i+=1;a+b>=l>exit(print('Possible',*range(1,i),*range(n-1,i-1,-1)))
print('Impossible') |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
0,
13,
17,
0,
13,
13,
3,
14,
2,
13,
... | [
[
119,
2
],
[
119,
11
],
[
107,
13
],
[
110,
25
],
[
29,
28
],
[
120,
32
],
[
108,
38
],
[
28,
39
],
[
108,
41
],
[
28,
43
],
[
117,
45
],
[
101,
47
],
[
113,
50
... | [
"N, L = map(int, input().split())\na = list(map(int, input().split()))\n\nf = 0\nfor i in range(N-1):\n if a[i] + a[i+1] >= L:\n f = 1\n t = i\n break\n#print(t)\nif f == 0:\n print(\"Impossible\")\nelse:\n print(\"Possible\")\n ans = []\n for i in range(t):\n ans.append(i... | N, L = map(int, input().split())
a = list(map(int, input().split()))
f = 0
for i in range(N-1):
if a[i] + a[i+1] >= L:
f = 1
t = i
break
#print(t)
if f == 0:
print("Impossible")
else:
print("Possible")
ans = []
for i in range(t):
ans.append(i+1)
for i in range(N-... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
0,
13,
2,
17,
17,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
4,
13,
... | [
[
101,
2
],
[
101,
11
],
[
15,
14
],
[
14,
23
],
[
95,
25
],
[
104,
28
],
[
98,
33
],
[
37,
36
],
[
102,
40
],
[
96,
46
],
[
36,
47
],
[
96,
49
],
[
36,
51
],
[... | [
"N, L = map(int, input().split())\na = [int(c) for c in input().split()]\nm = 10**9\nj = -1\nfor i in range(N-1):\n if a[i]+a[i+1]>=L:\n print('Possible')\n for j in range(1,i+1):\n print(j)\n for j in range(N-1, i+1, -1):\n print(j)\n print(i+1)\n break\nelse:\n print('Impossible')",
"... | N, L = map(int, input().split())
a = [int(c) for c in input().split()]
m = 10**9
j = -1
for i in range(N-1):
if a[i]+a[i+1]>=L:
print('Possible')
for j in range(1,i+1):
print(j)
for j in range(N-1, i+1, -1):
print(j)
print(i+1)
break
else:
print('Impossible')
|
[
7,
0,
13,
2,
17,
17,
0,
13,
2,
2,
17,
17,
17,
12,
13,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
... | [
[
140,
2
],
[
134,
7
],
[
17,
16
],
[
17,
25
],
[
28,
27
],
[
40,
39
],
[
43,
42
],
[
16,
46
],
[
27,
52
],
[
42,
53
],
[
27,
55
],
[
42,
57
],
[
25,
59
],
[
... | [
"INF = 10 ** 15\nMOD = 10 ** 9 + 7 \ndef main():\n N,L = map(int,input().split())\n A = list(map(int,input().split()))\n point = -1\n for i in range(N - 1):\n if A[i] + A[i + 1] >= L:\n point = i + 1\n break\n if point == - 1:\n print('Impossible')\n return\... | INF = 10 ** 15
MOD = 10 ** 9 + 7
def main():
N,L = map(int,input().split())
A = list(map(int,input().split()))
point = -1
for i in range(N - 1):
if A[i] + A[i + 1] >= L:
point = i + 1
break
if point == - 1:
print('Impossible')
return
ans = []
... |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
14,
40,
2,
18,
13,
13,
18,
13,
2,
13,
17,
13,
0,
13,
13,
3,
14,
2,
13,
17,
4,
13,
... | [
[
86,
2
],
[
86,
11
],
[
95,
13
],
[
89,
25
],
[
29,
28
],
[
87,
32
],
[
96,
38
],
[
28,
39
],
[
96,
41
],
[
28,
43
],
[
84,
45
],
[
92,
47
],
[
28,
48
],
[
... | [
"n, l = map(int, input().split())\na = list(map(int, input().split()))\nind = -1\nfor i in range(n-1):\n if a[i]+a[i+1] >= l:\n ind = i\n break\n\nif ind == -1:\n print(\"Impossible\")\nelse:\n print(\"Possible\")\n for i in range(ind):\n print(i+1)\n for i in range(n-1, ind, -1)... | n, l = map(int, input().split())
a = list(map(int, input().split()))
ind = -1
for i in range(n-1):
if a[i]+a[i+1] >= l:
ind = i
break
if ind == -1:
print("Impossible")
else:
print("Possible")
for i in range(ind):
print(i+1)
for i in range(n-1, ind, -1):
print(i)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.