node_ids
listlengths
4
1.4k
edge_index
listlengths
1
2.22k
text
listlengths
4
1.4k
source
stringlengths
14
427k
[ 7, 12, 13, 41, 28, 13, 4, 18, 4, 18, 4, 13, 13, 13, 17, 4, 4, 13, 13, 0, 13, 13, 13, 41, 28, 13, 4, 18, 4, 18, 4, 13, 13, 13, 17, 4, 4, 13, 13, 0, 13, 13, 28, 13, 4, 13, 17, 13, 14, 40, 2, 18, 13, 2, 13, 17...
[ [ 6, 5 ], [ 5, 18 ], [ 21, 20 ], [ 21, 22 ], [ 26, 25 ], [ 25, 38 ], [ 41, 40 ], [ 44, 43 ], [ 20, 47 ], [ 40, 52 ], [ 43, 54 ], [ 40, 57 ], [ 43, 58 ], [ 2...
[ "def main():\n n, l = (int(s) for s in input().strip().split(' '))\n an = [int (s) for s in input().strip().split(' ')]\n for i in range(1, n):\n if an[i-1] + an[i] >= l:\n print('Possible')\n index = i\n break\n else:\n print('Impossible')\n return\...
def main(): n, l = (int(s) for s in input().strip().split(' ')) an = [int (s) for s in input().strip().split(' ')] for i in range(1, n): if an[i-1] + an[i] >= l: print('Possible') index = i break else: print('Impossible') return 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, 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, 2, 13, 17, 0, 13, ...
[ [ 122, 2 ], [ 122, 11 ], [ 113, 13 ], [ 116, 25 ], [ 125, 28 ], [ 32, 31 ], [ 111, 35 ], [ 114, 41 ], [ 31, 42 ], [ 114, 44 ], [ 31, 46 ], [ 123, 48 ], [ 128, 50 ...
[ "#KNOT PUZZLE\nN,L=map(int,input().split())\nlists=list(map(int,input().split()))\nflag=False\nJ=0\nfor i in range(N-1):\n if lists[i]+lists[i+1]>=L:\n J=i+1\n flag=True\n break\nif not flag:\n print(\"Impossible\")\nif flag:\n print(\"Possible\")\n for i in range(100001,0,-1):\n ...
#KNOT PUZZLE N,L=map(int,input().split()) lists=list(map(int,input().split())) flag=False J=0 for i in range(N-1): if lists[i]+lists[i+1]>=L: J=i+1 flag=True break if not flag: print("Impossible") if flag: print("Possible") for i in range(100001,0,-1): if 1<=J-i<=N-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, 13, 28, 13, 4, 13, 2, 13, 17, 0, 13, 2, 18, 13, 13, 18, 13, 2, 13, 17, 14, 2, 13, 13, 0, 13, 13, 0, ...
[ [ 97, 2 ], [ 97, 11 ], [ 112, 13 ], [ 115, 25 ], [ 103, 28 ], [ 95, 29 ], [ 32, 31 ], [ 95, 35 ], [ 109, 38 ], [ 113, 41 ], [ 31, 42 ], [ 113, 44 ], [ 31, 46 ], ...
[ "N, L = map(int, input().split())\na = list((map(int, input().split())))\nlongest = 0\nlongest_i = N\nfor i in range(N-1):\n knot = a[i]+a[i+1]\n if knot > longest:\n longest = knot\n longest_i = i+1\nif longest < L:\n print(\"Impossible\")\nelse:\n print(\"Possible\")\n for i in range(...
N, L = map(int, input().split()) a = list((map(int, input().split()))) longest = 0 longest_i = N for i in range(N-1): knot = a[i]+a[i+1] if knot > longest: longest = knot longest_i = i+1 if longest < L: print("Impossible") else: print("Possible") for i in range(1,longest_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, 41, 28, 13, 4, 13, 2, 13, 17, 40, 2, 18, 13, 13, 18, 13, 2, 13, 17, 13, 4, 2, 13, 17, 0, 13, 13, 0, 13, 8, 13, 4, 18, ...
[ [ 107, 2 ], [ 107, 11 ], [ 98, 13 ], [ 27, 26 ], [ 96, 30 ], [ 99, 35 ], [ 26, 36 ], [ 99, 38 ], [ 26, 40 ], [ 108, 42 ], [ 26, 45 ], [ 104, 48 ], [ 101, 51 ], ...
[ "N, L = map(int, input().split())\na = list(map(int, input().split()))\n\nI = [i + 1 for i in range(N - 1) if a[i] + a[i + 1] >= L]\nans = (\n 'Possible\\n{}'.format(\n '\\n'.join(\n map(\n str,\n list(range(1, I[0])) + list(range(N - 1, I[0], -1)) + [I[0]]\n ...
N, L = map(int, input().split()) a = list(map(int, input().split())) I = [i + 1 for i in range(N - 1) if a[i] + a[i + 1] >= L] ans = ( 'Possible\n{}'.format( '\n'.join( map( str, list(range(1, I[0])) + list(range(N - 1, I[0], -1)) + [I[0]] ) )...
[ 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, 14, 2, 13, 17, 4, ...
[ [ 110, 2 ], [ 110, 11 ], [ 113, 13 ], [ 116, 25 ], [ 29, 28 ], [ 111, 32 ], [ 114, 38 ], [ 28, 39 ], [ 114, 41 ], [ 28, 43 ], [ 102, 45 ], [ 104, 47 ], [ 28, 49 ]...
[ "N, L = 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]>=L:\n k=i+1\nif k==-1:\n print(\"Impossible\")\nelse:\n print(\"Possible\")\n res = []\n for i in reversed(range(1,k+1)):\n res.append(i)\n for i in range(k+1,N):\n ...
N, L = map(int, input().split()) A = list(map(int, input().split())) k = -1 for i in range(N-1): if A[i]+A[i+1]>=L: k=i+1 if k==-1: print("Impossible") else: print("Possible") res = [] for i in reversed(range(1,k+1)): res.append(i) for i in range(k+1,N): res.append(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, 28, 13, 4, 13, 17, 13, 14, 40, 2, 18, 13, 2, 13, 17, 18, 13, 13, 13, 0, 13, 13...
[ [ 4, 3 ], [ 3, 12 ], [ 97, 14 ], [ 97, 16 ], [ 20, 19 ], [ 19, 28 ], [ 91, 30 ], [ 100, 33 ], [ 37, 36 ], [ 98, 40 ], [ 92, 45 ], [ 36, 47 ], [ 92, 50 ], [ ...
[ "\nn, l = [ int(v) for v in input().split() ]\nknot_list = [ int(v) for v in input().split() ]\n\npos = 0\nfor i in range(1,n):\n if knot_list[i-1] + knot_list[i] >= l:\n pos = i\n break\nif pos == 0:\n print(\"Impossible\")\nelse:\n print(\"Possible\")\n for i in range(1,pos):\n pr...
n, l = [ int(v) for v in input().split() ] knot_list = [ int(v) for v in input().split() ] pos = 0 for i in range(1,n): if knot_list[i-1] + knot_list[i] >= l: pos = i break if pos == 0: print("Impossible") else: print("Possible") for i in range(1,pos): print(i) for i in ran...
[ 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, 2, 4, 13, 4, 13, 17, 2, 13, ...
[ [ 96, 2 ], [ 96, 11 ], [ 90, 13 ], [ 26, 25 ], [ 97, 29 ], [ 91, 35 ], [ 25, 36 ], [ 91, 38 ], [ 25, 40 ], [ 94, 42 ], [ 87, 47 ], [ 25, 55 ], [ 25, 63 ], [ ...
[ "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 print('Possible')\n ans = list(range(1,i+1))+list(range(i+2,n))[::-1]\n ans.append(i+1)\n for i in ans:\n print(i)\n exit()\nprint('Impossible')", "n,l ...
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') ans = list(range(1,i+1))+list(range(i+2,n))[::-1] ans.append(i+1) for i in ans: print(i) exit() print('Impossible')
[ 7, 15, 13, 12, 13, 12, 13, 4, 18, 13, 13, 2, 17, 17, 0, 13, 4, 13, 13, 0, 13, 4, 13, 4, 13, 0, 13, 39, 28, 13, 4, 13, 17, 13, 0, 13, 2, 18, 13, 2, 13, 17, 18, 13, 13, 14, 40, 13, 13, 0, 13, 13, 4, 13, 17, 3...
[ [ 106, 15 ], [ 104, 17 ], [ 106, 18 ], [ 97, 20 ], [ 104, 24 ], [ 100, 26 ], [ 30, 29 ], [ 89, 33 ], [ 85, 35 ], [ 98, 38 ], [ 29, 40 ], [ 98, 43 ], [ 29, 44 ], ...
[ "import sys\ndef input(): return sys.stdin.readline().strip()\ndef mapint(): return map(int, input().split())\nsys.setrecursionlimit(10**9)\n\nN, L = mapint()\nAs = list(mapint())\n\nprocces = []\nfor i in range(1, N):\n double = As[i-1]+As[i]\n if double>=L:\n last = i\n print('Possible')\n ...
import sys def input(): return sys.stdin.readline().strip() def mapint(): return map(int, input().split()) sys.setrecursionlimit(10**9) N, L = mapint() As = list(mapint()) procces = [] for i in range(1, N): double = As[i-1]+As[i] if double>=L: last = i print('Possible') break else: ...
[ 7, 15, 13, 0, 13, 17, 0, 13, 17, 12, 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, 14, 2, 13, 13, 4, 13, 13, 29, 4, 13, 13, 0, 13, 4, 18, 13, 13, 13, 28...
[ [ 159, 4 ], [ 150, 7 ], [ 14, 13 ], [ 83, 17 ], [ 87, 22 ], [ 13, 23 ], [ 87, 25 ], [ 13, 27 ], [ 31, 30 ], [ 34, 33 ], [ 30, 36 ], [ 33, 39 ], [ 85, 40 ], [ ...
[ "#!/usr/bin/env python3\nimport sys\n\nYES = \"Possible\" # type: str\nNO = \"Impossible\" # type: str\n\ndef solve(N: int, L: int, a: \"List[int]\"):\n pair_length = [a[i] + a[i+1] for i in range(N-1)]\n longest_pair = max(pair_length)\n \n if longest_pair < L:\n print(NO)\n return\n ...
#!/usr/bin/env python3 import sys YES = "Possible" # type: str NO = "Impossible" # type: str def solve(N: int, L: int, a: "List[int]"): pair_length = [a[i] + a[i+1] for i in range(N-1)] longest_pair = max(pair_length) if longest_pair < L: print(NO) return print(YES) las...
[ 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, 17, 28, 13, 13, 4, 13, 13, 14, 40, ...
[ [ 115, 2 ], [ 115, 11 ], [ 106, 13 ], [ 27, 26 ], [ 110, 30 ], [ 107, 35 ], [ 26, 36 ], [ 107, 38 ], [ 26, 40 ], [ 103, 43 ], [ 112, 46 ], [ 104, 53 ], [ 116, 57 ...
[ "n,l = map(int, input().split())\nAs = list(map(int, input().split()))\n# 和がl以上のものがあれば、それを残してあとを端から落としていくのでよい\nss = [As[i]+As[i+1] for i in range(n-1)]\n# print(ss)\ncnt = 0\nfor i,s in enumerate(ss):\n if s >= l:\n cnt = i + 1\nif cnt == 0:\n print(\"Impossible\")\n exit()\nprint(\"Possible\")\nfor...
n,l = map(int, input().split()) As = list(map(int, input().split())) # 和がl以上のものがあれば、それを残してあとを端から落としていくのでよい ss = [As[i]+As[i+1] for i in range(n-1)] # print(ss) cnt = 0 for i,s in enumerate(ss): if s >= l: cnt = i + 1 if cnt == 0: print("Impossible") exit() print("Possible") for i in range(1,cnt): ...
[ 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, 39, 17, 28, 13, 4, 13, 13, 4, 18, 13, 13, 2, 18, 13, 13, 18, 13, 13, 0, 13, 39, 0, 13, 17, 13, 2, 13, 17, 0, 13, ...
[ [ 146, 2 ], [ 146, 11 ], [ 149, 13 ], [ 155, 25 ], [ 30, 29 ], [ 147, 32 ], [ 156, 35 ], [ 156, 39 ], [ 29, 40 ], [ 150, 42 ], [ 29, 43 ], [ 152, 45 ], [ 140, 48 ...
[ "n,L = map(int,input().split())\na = list(map(int,input().split()))\n\nr = [0]\nfor i in range(n):\n r.append(r[i] + a[i])\n\nansl = []\np,q = 0,n-1\nsuma = sum(a)\nwhile p < q:\n if r[q+1] - r[p] < L:\n print(\"Impossible\")\n exit()\n if a[p] + a[p + 1] <= a[q-1] + a[q]:\n ansl.appe...
n,L = map(int,input().split()) a = list(map(int,input().split())) r = [0] for i in range(n): r.append(r[i] + a[i]) ansl = [] p,q = 0,n-1 suma = sum(a) while p < q: if r[q+1] - r[p] < L: print("Impossible") exit() if a[p] + a[p + 1] <= a[q-1] + a[q]: ansl.append(p + 1) p+=1...
[ 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, 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, ...
[ [ 113, 4 ], [ 113, 13 ], [ 110, 15 ], [ 98, 27 ], [ 101, 30 ], [ 34, 33 ], [ 114, 37 ], [ 111, 43 ], [ 33, 44 ], [ 111, 46 ], [ 33, 48 ], [ 108, 50 ], [ 95, 52 ],...
[ "import numpy as np\nn,l=map(int,input().split())\na=list(map(int,input().split()))\nflag=False;idx=0\nfor i in range(n-1):\n if a[i]+a[i+1]>=l:\n flag=True\n idx=i\nif not flag:\n print(\"Impossible\")\n exit(0)\nprint(\"Possible\")\nfor x in range(idx):\n print(x+1)\nfor x in reversed(range(idx,n-1)):\n...
import numpy as np n,l=map(int,input().split()) a=list(map(int,input().split())) flag=False;idx=0 for i in range(n-1): if a[i]+a[i+1]>=l: flag=True idx=i if not flag: print("Impossible") exit(0) print("Possible") for x in range(idx): print(x+1) for x in reversed(range(idx,n-1)): print(x+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, 41, 28, 13, 4, 13, 2, 13, 17, 4, 2, 18, 13, 13, 18, 13, 2, 13, 17, 0, 13, 13, 14, 4, 13, 4, 13, 12, 40, 13, 13, 23, 13, ...
[ [ 117, 2 ], [ 117, 11 ], [ 108, 13 ], [ 27, 26 ], [ 118, 30 ], [ 109, 35 ], [ 26, 36 ], [ 109, 38 ], [ 26, 40 ], [ 105, 43 ], [ 115, 53 ], [ 106, 55 ], [ 106, 64 ...
[ "N, L = map(int, input().split())\nA = list(map(int, input().split()))\n\n\nX = [A[i] + A[i + 1] for i in range(N - 1)]\nif any(map(lambda x: x >= L, X)):\n print('Possible')\n\n for i, x in enumerate(X, start=1):\n if x >= L:\n xi = i\n break\n\n for i in range(1, xi):\n ...
N, L = map(int, input().split()) A = list(map(int, input().split())) X = [A[i] + A[i + 1] for i in range(N - 1)] if any(map(lambda x: x >= L, X)): print('Possible') for i, x in enumerate(X, start=1): if x >= L: xi = i break for i in range(1, xi): print(i) for ...
[ 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, 29, 39, 13, 13, 13, 12, 13, 28, 13, 4, 13, 2, 13, 17, 14, 40, 2, 18, 13, 13, 18, 13, 2, 13, 17, 13, 29, 2, 4, 13...
[ [ 5, 4 ], [ 5, 13 ], [ 16, 15 ], [ 35, 34 ], [ 74, 38 ], [ 78, 44 ], [ 34, 45 ], [ 78, 47 ], [ 34, 49 ], [ 76, 51 ], [ 34, 60 ], [ 74, 67 ], [ 34, 69 ], [ 7...
[ "def read_data():\n N, L = map(int, input().split())\n As = list(map(int, input().split()))\n return N, L, As\n\ndef solve(N, L, As):\n for i in range(N - 1):\n if As[i] + As[i + 1] >= L:\n return list(range(1, i + 1)) + list(range(N - 1, i, - 1))\n return []\n\nN, L, As = read_data...
def read_data(): N, L = map(int, input().split()) As = list(map(int, input().split())) return N, L, As def solve(N, L, As): for i in range(N - 1): if As[i] + As[i + 1] >= L: return list(range(1, i + 1)) + list(range(N - 1, i, - 1)) return [] N, L, As = read_data() ans = solve(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, ...
[ [ 93, 2 ], [ 93, 11 ], [ 96, 13 ], [ 99, 25 ], [ 29, 28 ], [ 91, 32 ], [ 97, 38 ], [ 28, 39 ], [ 97, 41 ], [ 28, 43 ], [ 94, 45 ], [ 102, 47 ], [ 28, 48 ], [ ...
[ "n, L = map(int, input().split())\na = list(map(int, input().split()))\nst = -1\nfor i in range(n-1):\n if a[i] + a[i+1] >= L:\n st = i\n break\nif st < 0:\n print(\"Impossible\")\nelse:\n print(\"Possible\")\n for i in range(st):\n print(i+1)\n for i in range(n-2, st, -1):\n ...
n, L = map(int, input().split()) a = list(map(int, input().split())) st = -1 for i in range(n-1): if a[i] + a[i+1] >= L: st = i break if st < 0: print("Impossible") else: print("Possible") for i in range(st): print(i+1) for i in range(n-2, st, -1): print(i+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, 17, 0, 13, 17, 28, 13, 4, 13, 2, 13, 17, 0, 13, 2, 18, 13, 13, 18, 13, 2, 13, 17, 14, 2, 13, 13, 0, 13, 13, 0, ...
[ [ 101, 2 ], [ 101, 11 ], [ 107, 13 ], [ 110, 25 ], [ 95, 28 ], [ 32, 31 ], [ 102, 35 ], [ 113, 38 ], [ 108, 41 ], [ 31, 42 ], [ 108, 44 ], [ 31, 46 ], [ 114, 50 ]...
[ "n,l = map(int, input().split())\na = list(map(int, input().split()))\nMAX = 0\nMAX_i = 0\nfor i in range(n-1):\n now = a[i] + a[i+1]\n if now > MAX:\n MAX = now\n MAX_i = i\nif MAX >= l:\n print(\"Possible\")\n for i in range(MAX_i):\n print(i+1)\n for i in range(n-MAX_i-1):\n print(n-i-1)\nelse:\...
n,l = map(int, input().split()) a = list(map(int, input().split())) MAX = 0 MAX_i = 0 for i in range(n-1): now = a[i] + a[i+1] if now > MAX: MAX = now MAX_i = i if MAX >= l: print("Possible") for i in range(MAX_i): print(i+1) for i in range(n-MAX_i-1): print(n-i-1) 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, 2, 13, 17, 14, 2, ...
[ [ 115, 2 ], [ 115, 11 ], [ 130, 13 ], [ 109, 25 ], [ 136, 28 ], [ 32, 31 ], [ 107, 35 ], [ 131, 41 ], [ 31, 42 ], [ 131, 44 ], [ 31, 46 ], [ 116, 48 ], [ 127, 50 ...
[ "# coding: utf-8\nN, L = map(int, input().split())\nA = list(map(int, input().split()))\nflag = True\nl = -1\nfor i in range(N-1):\n if A[i] + A[i+1] >= L:\n l = i+1\nif l < 0:\n print(\"Impossible\")\n exit()\nknot = list(range(1, N))\nprint(\"Possible\")\nidx = 1\nwhile idx < l:\n print(idx)\n ...
# coding: utf-8 N, L = map(int, input().split()) A = list(map(int, input().split())) flag = True l = -1 for i in range(N-1): if A[i] + A[i+1] >= L: l = i+1 if l < 0: print("Impossible") exit() knot = list(range(1, N)) print("Possible") idx = 1 while idx < l: print(idx) idx += 1 idx = N-1 whi...
[ 7, 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, 18, 4, 18, 18, 13, 13, 13, 13, 0, 13, 12, 4, 13, 8, 13, 39, 4, 13, 17, 4, 13, 17, 23, 0, 13, 12, 4, 13, 8, 13, ...
[ [ 172, 11 ], [ 175, 16 ], [ 169, 23 ], [ 166, 35 ], [ 160, 50 ], [ 163, 65 ], [ 77, 76 ], [ 170, 83 ], [ 77, 85 ], [ 88, 87 ], [ 170, 96 ], [ 100, 99 ], [ 76, 103 ...
[ "# -*- coding: utf-8 -*-\nimport sys\nsys.setrecursionlimit(10**9)\nINF=10**18\nMOD=10**9+7\ninput=lambda: sys.stdin.readline().rstrip()\nYesNo=lambda b: bool([print('Yes')] if b else print('No'))\nYESNO=lambda b: bool([print('YES')] if b else print('NO'))\nint1=lambda x:int(x)-1\n\ndef main():\n N,L=map(int,inp...
# -*- coding: utf-8 -*- import sys sys.setrecursionlimit(10**9) INF=10**18 MOD=10**9+7 input=lambda: sys.stdin.readline().rstrip() YesNo=lambda b: bool([print('Yes')] if b else print('No')) YESNO=lambda b: bool([print('YES')] if b else print('NO')) int1=lambda x:int(x)-1 def main(): N,L=map(int,input().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, 0, 13, 4, 13, 13, 0, 13, 17, 28, 13, 4, 13, 17, 13, 14, 40, 2, 18, 13, 13, 18, 13, 2, 13, 17, 13, 0, 13, 17, 0, 13, 13, ...
[ [ 115, 2 ], [ 115, 11 ], [ 118, 13 ], [ 109, 25 ], [ 119, 28 ], [ 112, 30 ], [ 34, 33 ], [ 107, 37 ], [ 119, 42 ], [ 33, 43 ], [ 119, 45 ], [ 33, 47 ], [ 116, 49 ...
[ "N,L=map(int,input().split())\na=list(map(int,input().split()))\nsuma=sum(a)\nflag=0\nfor i in range(1,N):\n if a[i]+a[i-1]>=L:\n flag=1\n idx=i\n break\nif flag:\n print(\"Possible\")\n for i in range(1,N):\n if idx==i:\n break\n else:\n print(i)\n ...
N,L=map(int,input().split()) a=list(map(int,input().split())) suma=sum(a) flag=0 for i in range(1,N): if a[i]+a[i-1]>=L: flag=1 idx=i break if flag: print("Possible") for i in range(1,N): if idx==i: break else: print(i) for i in range(N-1,0...
[ 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, 2, 13, 17, 14, 40, 2, 18, 13, 13, 18, 13, 2, 13, 17, 13, 4, 13, 17, 28, 13, 4, 13, 17, 2, 13, 17, 4, ...
[ [ 113, 2 ], [ 113, 11 ], [ 110, 13 ], [ 26, 25 ], [ 114, 30 ], [ 111, 36 ], [ 25, 37 ], [ 111, 39 ], [ 25, 41 ], [ 108, 43 ], [ 49, 48 ], [ 25, 53 ], [ 48, 57 ], ...
[ "N,L=map(int,input().split())\nA=list(map(int,input().split()))\n\nfor i in range(0,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 T=[]\n for j in range(i+2,N):\n T.append(j)\n T.sort(reverse=True)\n for j in ra...
N,L=map(int,input().split()) A=list(map(int,input().split())) for i in range(0,N-1): if A[i]+A[i+1]>=L: print('Possible') for j in range(1,i+1): print(j) T=[] for j in range(i+2,N): T.append(j) T.sort(reverse=True) for j in range(0,len(T)): ...
[ 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, 14, 2, 13, 17, 4, 13, 17, ...
[ [ 113, 2 ], [ 113, 11 ], [ 116, 13 ], [ 119, 25 ], [ 29, 28 ], [ 114, 32 ], [ 117, 38 ], [ 28, 39 ], [ 117, 41 ], [ 28, 43 ], [ 111, 45 ], [ 125, 47 ], [ 28, 48 ]...
[ "N, L = map(int, input().split())\nA = list(map(int, input().split()))\n\nstart = -1\nfor i in range(N-1):\n if A[i] + A[i + 1] >= L:\n start = i\nif start < 0:\n print(\"Impossible\")\n exit()\n\nans = [start + 1]\nfor i in range(start + 1, N - 1):\n ans.append(i+1)\nfor i in reversed(range(star...
N, L = map(int, input().split()) A = list(map(int, input().split())) start = -1 for i in range(N-1): if A[i] + A[i + 1] >= L: start = i if start < 0: print("Impossible") exit() ans = [start + 1] for i in range(start + 1, N - 1): ans.append(i+1) for i in reversed(range(start)): ans.append(i...
[ 7, 12, 13, 0, 13, 4, 13, 13, 4, 18, 4, 18, 4, 13, 17, 13, 13, 13, 31, 13, 41, 28, 13, 13, 4, 13, 13, 18, 13, 39, 17, 4, 2, 13, 13, 0, 13, 13, 0, 13, 4, 13, 13, 14, 2, 13, 13, 4, 13, 17, 29, 0, 13, 2, 4, 18,...
[ [ 5, 4 ], [ 5, 17 ], [ 5, 18 ], [ 37, 36 ], [ 40, 39 ], [ 36, 42 ], [ 39, 45 ], [ 17, 46 ], [ 53, 52 ], [ 36, 56 ], [ 39, 58 ], [ 63, 62 ], [ 52, 66 ], [ 62...
[ "# AGC002C - Knot Puzzle\ndef main():\n N, L, *A = map(int, open(0).read().split())\n B = [i + j for i, j in zip(A, A[1:])]\n x = max(B)\n if x < L: # corner case\n print(\"Impossible\")\n return\n idx = B.index(x) + 1\n # keep the biggest one until the end\n ans = [i for i in ra...
# AGC002C - Knot Puzzle def main(): N, L, *A = map(int, open(0).read().split()) B = [i + j for i, j in zip(A, A[1:])] x = max(B) if x < L: # corner case print("Impossible") return idx = B.index(x) + 1 # keep the biggest one until the end ans = [i for i in range(1, idx)] + [i...
[ 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, 17, 3, 14, 13, 4, ...
[ [ 94, 2 ], [ 94, 11 ], [ 15, 14 ], [ 14, 23 ], [ 88, 25 ], [ 97, 28 ], [ 32, 31 ], [ 92, 35 ], [ 89, 41 ], [ 31, 42 ], [ 89, 44 ], [ 31, 46 ], [ 95, 48 ], [ ...
[ "N, L = map(int, input().split())\na = [int(x) for x in input().split()]\n\nans = False\nfor i in range(N-1):\n if a[i] + a[i+1] >= L:\n ans = True\n break\nif ans:\n print('Possible')\n for j in range(i):\n print(j+1)\n for j in range(N-2, i-1, -1):\n print(j+1)\nelse:\n ...
N, L = map(int, input().split()) a = [int(x) for x in input().split()] ans = False for i in range(N-1): if a[i] + a[i+1] >= L: ans = True break if ans: print('Possible') for j in range(i): print(j+1) for j in range(N-2, i-1, -1): print(j+1) 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, 4, 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, 14, 2, 13, ...
[ [ 104, 2 ], [ 104, 11 ], [ 95, 13 ], [ 98, 25 ], [ 31, 30 ], [ 93, 34 ], [ 96, 40 ], [ 30, 41 ], [ 96, 43 ], [ 30, 45 ], [ 105, 47 ], [ 101, 49 ], [ 30, 51 ], [...
[ "n, l = map(int, input().split())\na = list(map(int, input().split()))\nans = float(\"inf\")\nfor i in range(n - 1):\n if a[i] + a[i + 1] >= l:\n ans = i + 1\nif ans == float(\"inf\"):\n print(\"Impossible\")\nelse:\n print(\"Possible\")\n print(*range(1, ans), sep=\"\\n\")\n print(*range(n - ...
n, l = map(int, input().split()) a = list(map(int, input().split())) ans = float("inf") for i in range(n - 1): if a[i] + a[i + 1] >= l: ans = i + 1 if ans == float("inf"): print("Impossible") else: print("Possible") print(*range(1, ans), sep="\n") print(*range(n - 1, ans, -1), sep="\n") ...
[ 7, 15, 13, 12, 13, 28, 13, 4, 13, 2, 13, 17, 14, 40, 2, 18, 13, 13, 18, 13, 2, 13, 17, 13, 3, 4, 13, 17, 29, 4, 13, 17, 28, 13, 4, 13, 2, 13, 17, 14, 2, 13, 13, 3, 4, 13, 2, 13, 17, 28, 13, 4, 13, 2, 13, 17...
[ [ 7, 6 ], [ 74, 10 ], [ 78, 16 ], [ 6, 17 ], [ 78, 19 ], [ 6, 21 ], [ 76, 23 ], [ 34, 33 ], [ 74, 37 ], [ 33, 41 ], [ 33, 47 ], [ 51, 50 ], [ 74, 54 ], [ 50...
[ "# でつoO(YOU PLAY WITH THE CARDS YOU'RE DEALT..)\nimport sys\ndef main(N, L, A):\n for i in range(N - 1):\n if A[i] + A[i + 1] >= L:\n break\n else:\n print('Impossible')\n return\n print('Possible')\n for j in range(N - 1):\n if j == i:\n break\n ...
# でつoO(YOU PLAY WITH THE CARDS YOU'RE DEALT..) import sys def main(N, L, A): for i in range(N - 1): if A[i] + A[i + 1] >= L: break else: print('Impossible') return print('Possible') for j in range(N - 1): if j == i: break print(j + 1) f...
[ 7, 12, 13, 0, 13, 4, 13, 13, 4, 18, 4, 18, 4, 13, 17, 13, 13, 13, 31, 13, 41, 28, 13, 39, 13, 13, 4, 13, 4, 13, 13, 18, 13, 39, 17, 17, 40, 2, 13, 13, 13, 4, 13, 0, 13, 13, 14, 13, 4, 13, 17, 41, 28, 13, 4, ...
[ [ 5, 4 ], [ 5, 17 ], [ 5, 18 ], [ 17, 40 ], [ 45, 44 ], [ 54, 53 ], [ 44, 57 ], [ 17, 57 ], [ 4, 59 ], [ 53, 61 ], [ 64, 63 ], [ 63, 74 ], [ 79, 78 ], [ 91,...
[ "def main():\n N, L, *A = map(int, open(0).read().split())\n L = [i for i,(x,y) in enumerate(zip(A, A[1:]), 1) if x+y >= L]\n if L:\n print(\"Possible\")\n B = [i for i in range(L[0], N)]+[i for i in range(1,L[0])][::-1]\n print(*B[::-1], sep=\"\\n\")\n else:\n print(\"Imposs...
def main(): N, L, *A = map(int, open(0).read().split()) L = [i for i,(x,y) in enumerate(zip(A, A[1:]), 1) if x+y >= L] if L: print("Possible") B = [i for i in range(L[0], N)]+[i for i in range(1,L[0])][::-1] print(*B[::-1], sep="\n") else: print("Impossible") if __name_...
[ 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, 17, 28, 13, 13, 4, 13, 13, 14, 40, ...
[ [ 108, 2 ], [ 108, 11 ], [ 99, 13 ], [ 27, 26 ], [ 109, 30 ], [ 100, 35 ], [ 26, 36 ], [ 100, 38 ], [ 26, 40 ], [ 96, 43 ], [ 111, 46 ], [ 97, 53 ], [ 106, 57 ], ...
[ "n, l = map(int, input().split())\na = list(map(int, input().split()))\nb = [a[i]+a[i+1] for i in range(n-1)]\nstart = -1\nfor ind, length in enumerate(b):\n if length >= l:\n start = ind+1\n break\nif start<0:\n print(\"Impossible\")\nelse:\n print(\"Possible\")\n for i in range(1,start):...
n, l = map(int, input().split()) a = list(map(int, input().split())) b = [a[i]+a[i+1] for i in range(n-1)] start = -1 for ind, length in enumerate(b): if length >= l: start = ind+1 break if start<0: print("Impossible") else: print("Possible") for i in range(1,start): 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, 14, 40, 2, 18, 13, 17, 18, 13, 17, 13, 4, 13, 17, 28, 13, 4, 13, 2, 13, 17, 17, 17, 4, 13, 14, 40, 2, 18, 13, 17, 18, 13...
[ [ 126, 2 ], [ 126, 11 ], [ 123, 13 ], [ 124, 28 ], [ 124, 31 ], [ 127, 33 ], [ 39, 38 ], [ 121, 42 ], [ 124, 52 ], [ 124, 55 ], [ 127, 57 ], [ 63, 62 ], [ 121, 66 ...
[ "n,l=map(int,input().split())\na=list(map(int,input().split()))\nif a[0]+a[1]>=l:\n print(\"Possible\")\n for i in range(n-1,0,-1):print(i)\n exit()\nif a[-2]+a[-1]>=l:\n print(\"Possible\")\n for i in range(1,n):print(i)\n exit()\nans=-1\nfor i in range(1,n):\n if a[i-1]+a[i]>=l:\n ans=i\n break\nif a...
n,l=map(int,input().split()) a=list(map(int,input().split())) if a[0]+a[1]>=l: print("Possible") for i in range(n-1,0,-1):print(i) exit() if a[-2]+a[-1]>=l: print("Possible") for i in range(1,n):print(i) exit() ans=-1 for i in range(1,n): if a[i-1]+a[i]>=l: ans=i break if ans==-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, 3, 14, 40, 13, 4, 13, 17, ...
[ [ 100, 2 ], [ 100, 11 ], [ 103, 13 ], [ 97, 25 ], [ 29, 28 ], [ 95, 32 ], [ 104, 38 ], [ 28, 39 ], [ 104, 41 ], [ 28, 43 ], [ 101, 45 ], [ 91, 47 ], [ 92, 52 ], ...
[ "N, L = map(int, input().split())\nA = list(map(int, input().split()))\nflg = False\nfor i in range(N - 1):\n if A[i] + A[i+1] >= L:\n flg = True\n break\nif not flg:\n print(\"Impossible\")\n exit()\nelse:\n print(\"Possible\")\n# 0, 1, ..., i - 1, [i], [i+1], i + 2, ..., N - 1\nfor j in ...
N, L = map(int, input().split()) A = list(map(int, 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") exit() else: print("Possible") # 0, 1, ..., i - 1, [i], [i+1], i + 2, ..., N - 1 for j in range(i): print(j ...
[ 7, 12, 13, 12, 13, 12, 13, 41, 28, 13, 4, 13, 13, 4, 4, 13, 12, 13, 23, 13, 41, 28, 13, 4, 13, 13, 4, 4, 13, 12, 13, 23, 13, 0, 13, 4, 13, 13, 0, 13, 2, 39, 17, 4, 13, 28, 13, 4, 13, 17, 13, 14, 40, 2, 18, ...
[ [ 10, 9 ], [ 113, 15 ], [ 19, 19 ], [ 23, 22 ], [ 107, 28 ], [ 32, 32 ], [ 109, 34 ], [ 101, 36 ], [ 109, 37 ], [ 103, 39 ], [ 107, 44 ], [ 47, 46 ], [ 95, 50 ], ...
[ "def N(): return int(input())\ndef NM():return map(int,input().split())\ndef L():return list(NM())\ndef LN(n):return [N() for i in range(n)]\ndef LL(n):return [L() for i in range(n)]\nn,l=NM()\na=[0]+L()\nfor i in range(1,n):\n if a[i]+a[i+1]>=l:\n print(\"Possible\")\n for j in range(1,i):\n ...
def N(): return int(input()) def NM():return map(int,input().split()) def L():return list(NM()) def LN(n):return [N() for i in range(n)] def LL(n):return [L() for i in range(n)] n,l=NM() a=[0]+L() for i in range(1,n): if a[i]+a[i+1]>=l: print("Possible") for j in range(1,i): print(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, 0, 13, 17, 28, 13, 4, 13, 17, 13, 14, 40, 2, 18, 13, 2, 13, 17, 18, 13, 13, 13, 0, 13, 17, 3, 14, 2, 13, 17, 4, 13, ...
[ [ 104, 3 ], [ 104, 12 ], [ 101, 14 ], [ 92, 26 ], [ 30, 29 ], [ 105, 33 ], [ 102, 38 ], [ 29, 40 ], [ 102, 43 ], [ 29, 44 ], [ 99, 45 ], [ 95, 47 ], [ 96, 52 ], ...
[ "from collections import deque\n\nn,l=map(int,input().split())\na=list(map(int,input().split()))\n\ns=\"\"\n\nfor i in range(1,n):\n if a[i-1]+a[i]>=l:\n s=\"p\"\n break\n\nif s==\"\":\n print(\"Impossible\")\n exit()\nprint(\"Possible\")\n \nfor j in range(1,i):\n print(j)\nfor j in range(1,len(a)-i):\n...
from collections import deque n,l=map(int,input().split()) a=list(map(int,input().split())) s="" for i in range(1,n): if a[i-1]+a[i]>=l: s="p" break if s=="": print("Impossible") exit() print("Possible") for j in range(1,i): print(j) for j in range(1,len(a)-i): print(len(a)-j) print(i)
[ 7, 12, 13, 28, 13, 4, 13, 2, 4, 13, 13, 17, 14, 40, 2, 18, 13, 13, 18, 13, 2, 13, 17, 13, 29, 2, 4, 13, 17, 13, 4, 13, 2, 4, 13, 13, 17, 2, 13, 17, 17, 29, 39, 23, 13, 23, 13, 12, 13, 41, 28, 13, 4, 18, 4, ...
[ [ 5, 4 ], [ 44, 10 ], [ 44, 16 ], [ 4, 17 ], [ 44, 19 ], [ 4, 21 ], [ 46, 23 ], [ 4, 29 ], [ 44, 35 ], [ 4, 38 ], [ 44, 44 ], [ 46, 46 ], [ 52, 51 ], [ 51, ...
[ "def cutSequence(piles, threshold):\n for i in xrange(len(piles)-1):\n if piles[i]+piles[i+1]>=threshold:\n return range(0, i)+range(len(piles)-2, i-1, -1)\n return []\n\ndef main():\n n, m = [int(x) for x in raw_input().strip().split()]\n a = [int(x) for x in raw_input().strip().split...
def cutSequence(piles, threshold): for i in xrange(len(piles)-1): if piles[i]+piles[i+1]>=threshold: return range(0, i)+range(len(piles)-2, i-1, -1) return [] def main(): n, m = [int(x) for x in raw_input().strip().split()] a = [int(x) for x in raw_input().strip().split()] foo =...
[ 7, 15, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 13, 29, 4, 18, 4, 13, 13, 12, 13, 29, 4, 13, 4, 13, 12, 13, 29, 4, 13, 4, 13, 12, 13, 29, 4, 18, 4, 18, 4, 13, 13, 13, 12, 13, 29, 4, 13, 13, 4, 18, 4, 18, ...
[ [ 78, 77 ], [ 95, 94 ], [ 114, 113 ], [ 224, 129 ], [ 198, 131 ], [ 224, 132 ], [ 209, 134 ], [ 198, 136 ], [ 191, 138 ], [ 142, 141 ], [ 225, 145 ], [ 210, 151 ], [ 14...
[ "# -*- coding: utf-8 -*-\nimport math,string,itertools,fractions,heapq,collections,re,array,bisect,sys\n\ndef s():\n return raw_input().strip()\ndef n():\n return int(raw_input())\ndef d():\n return float(raw_input())\n\ndef ls():\n return raw_input().strip().split()\ndef ln():\n return map(int, raw_...
# -*- coding: utf-8 -*- import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys def s(): return raw_input().strip() def n(): return int(raw_input()) def d(): return float(raw_input()) def ls(): return raw_input().strip().split() def ln(): return map(int, raw_input().strip().sp...
[ 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, 17, 28, 13, 4, 13, 2, 13, 17, 14, 40, 2, 18, 13, 13, 18, 13, 2, 13, 17, 13, 0, 13, 13, 14, 2, 13, 17, 4, ...
[ [ 5, 4 ], [ 5, 13 ], [ 16, 15 ], [ 28, 27 ], [ 31, 30 ], [ 4, 34 ], [ 15, 40 ], [ 30, 41 ], [ 15, 43 ], [ 30, 45 ], [ 13, 47 ], [ 50, 49 ], [ 30, 50 ], [ 49...
[ "# -*- coding: utf-8 -*-\n\n\ndef main():\n n, l = map(int, input().split())\n a = list(map(int, input().split()))\n\n # KeyInsight\n # 最後から直前の状態を考える\n # ある位置a[i]と右隣の値a[i+1]の和がL以上であれば構成できる\n # iの位置を特定\n # 左右の両端から切る\n pos = -1\n\n for i in range(n - 1):\n if (a[i] + a[i + 1]) >= l:\...
# -*- coding: utf-8 -*- def main(): n, l = map(int, input().split()) a = list(map(int, input().split())) # KeyInsight # 最後から直前の状態を考える # ある位置a[i]と右隣の値a[i+1]の和がL以上であれば構成できる # iの位置を特定 # 左右の両端から切る pos = -1 for i in range(n - 1): if (a[i] + a[i + 1]) >= l: pos = 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, 0, 13, 17, 28, 13, 4, 13, 2, 13, 17, 14, 2, 2, 18, 13, 13, 18, 13, 2, 13, 17, 13, 0, 13, 2, 18, 13, 13, 18, 13, 2, 13, ...
[ [ 127, 2 ], [ 127, 11 ], [ 115, 13 ], [ 121, 25 ], [ 29, 28 ], [ 119, 32 ], [ 116, 38 ], [ 28, 39 ], [ 116, 41 ], [ 28, 43 ], [ 122, 45 ], [ 113, 45 ], [ 112, 47 ...
[ "N, L = map(int, input().split())\nA = list(map(int, input().split()))\n\ns = 0\nfor i in range(N-1):\n if A[i] + A[i+1] > s:\n s = A[i] + A[i+1]\n ind = i\n\nif s < L:\n print('Impossible')\nelse:\n print('Possible')\n for i in range(N-1):\n if i == ind:\n break\n ...
N, L = map(int, input().split()) A = list(map(int, input().split())) s = 0 for i in range(N-1): if A[i] + A[i+1] > s: s = A[i] + A[i+1] ind = i if s < L: print('Impossible') else: print('Possible') for i in range(N-1): if i == ind: break print(i+1) for i...
[ 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, 39, 28, 13, 4, 13, 2, 13, 17, 4, 18, 13, 13, 13, 39, 2, 40, 18, 13, 13, 18, 13, 2, 13, 17, 13, 0, 13, 39,...
[ [ 177, 4 ], [ 177, 13 ], [ 174, 15 ], [ 189, 27 ], [ 31, 30 ], [ 178, 34 ], [ 190, 40 ], [ 175, 45 ], [ 30, 46 ], [ 175, 48 ], [ 30, 50 ], [ 183, 54 ], [ 195, 57 ...
[ "import heapq\nN, K = map(int, input().split())\nA = list(map(int, input().split()))\n\nknot = []\nfor i in range(N - 1):\n heapq.heappush(knot, (-A[i]-A[i+1], i))\n\nans = []\nseen = [False]*N\nwhile knot:\n L, i = heapq.heappop(knot)\n L = -L\n\n if seen[i]:\n continue\n if L < K:\n b...
import heapq N, K = map(int, input().split()) A = list(map(int, input().split())) knot = [] for i in range(N - 1): heapq.heappush(knot, (-A[i]-A[i+1], i)) ans = [] seen = [False]*N while knot: L, i = heapq.heappop(knot) L = -L if seen[i]: continue if L < K: break seen[i] = Tr...
[ 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, 39, 28, 13, 4, 13, 2, 13, 17, 14, 40, 2, 18, 13, 13, 18, 13, 2, 13, 17, 13, 41, 28, 13, 4, 13, 17, 2, ...
[ [ 105, 2 ], [ 105, 11 ], [ 108, 13 ], [ 90, 25 ], [ 93, 28 ], [ 32, 31 ], [ 106, 35 ], [ 109, 41 ], [ 31, 42 ], [ 109, 44 ], [ 31, 46 ], [ 103, 48 ], [ 52, 51 ], ...
[ "#002_C\nn, l = map(int, input().split())\na = list(map(int, input().split()))\n\nflg = False\nans = []\nfor i in range(n-1):\n if a[i] + a[i+1] >= l:\n ans = [j for j in range(1, i+1)] + [j for j in range(n-1, i+1, -1)] + [i+1]\n flg = True\n break\n \nif flg:\n print('Possible')\n ...
#002_C n, l = map(int, input().split()) a = list(map(int, input().split())) flg = False ans = [] for i in range(n-1): if a[i] + a[i+1] >= l: ans = [j for j in range(1, i+1)] + [j for j in range(n-1, i+1, -1)] + [i+1] flg = True break if flg: print('Possible') print(*ans, sep='\...
[ 7, 12, 13, 28, 13, 4, 13, 2, 13, 17, 4, 13, 2, 13, 17, 28, 13, 4, 13, 2, 13, 17, 2, 13, 17, 17, 4, 13, 13, 23, 13, 23, 13, 0, 13, 4, 13, 13, 4, 18, 4, 13, 13, 17, 13, 0, 13, 4, 18, 4, 13, 13, 17, 41, 28, 13...
[ [ 5, 4 ], [ 32, 8 ], [ 4, 13 ], [ 17, 16 ], [ 30, 20 ], [ 32, 23 ], [ 16, 28 ], [ 30, 30 ], [ 32, 32 ], [ 122, 34 ], [ 122, 44 ], [ 125, 46 ], [ 56, 55 ], [ ...
[ "def dump(n,k):\n for i in range(k-1):\n print(i+1)\n for i in range(n-1,k-1,-1):\n print(i)\n\nn,l=map(int,input().split(' '))\na=input().split(' ')\na=[int(s) for s in a]\n\nk=0\nfor i in range(n-1):\n if a[i]+a[i+1]>=l:\n k=i+1\n break\n\nif k==0:\n print(\"Impossible\")\nelse:\n print(\"Possibl...
def dump(n,k): for i in range(k-1): print(i+1) for i in range(n-1,k-1,-1): print(i) n,l=map(int,input().split(' ')) a=input().split(' ') a=[int(s) for s in a] k=0 for i in range(n-1): if a[i]+a[i+1]>=l: k=i+1 break if k==0: print("Impossible") else: print("Possible") dump(n,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, 2, 13, 17, 0, 13, 2, 18, 13, 13, 18, 13, 2, 13, 17, 14, 2, 13, 13, 0, 13, 13, 0, ...
[ [ 121, 2 ], [ 121, 11 ], [ 130, 13 ], [ 109, 25 ], [ 124, 28 ], [ 32, 31 ], [ 116, 35 ], [ 118, 38 ], [ 131, 41 ], [ 31, 42 ], [ 131, 44 ], [ 31, 46 ], [ 125, 50 ...
[ "n, l = map(int, input().split())\naaa = list(map(int, input().split()))\n\nmax_i = 0\nmax_two_ropes = 0\nfor i in range(n - 1):\n two_ropes = aaa[i] + aaa[i + 1]\n if max_two_ropes < two_ropes:\n max_i = i\n max_two_ropes = two_ropes\n\nif max_two_ropes < l:\n print('Impossible')\nelse:\n ...
n, l = map(int, input().split()) aaa = list(map(int, input().split())) max_i = 0 max_two_ropes = 0 for i in range(n - 1): two_ropes = aaa[i] + aaa[i + 1] if max_two_ropes < two_ropes: max_i = i max_two_ropes = two_ropes if max_two_ropes < l: print('Impossible') else: print('Possible') ...
[ 7, 0, 13, 4, 13, 13, 4, 18, 4, 13, 13, 13, 0, 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, 14, 2, 13, 17, 4, 13, 17, ...
[ [ 93, 2 ], [ 93, 11 ], [ 96, 13 ], [ 90, 23 ], [ 27, 26 ], [ 88, 30 ], [ 97, 36 ], [ 26, 37 ], [ 97, 39 ], [ 26, 41 ], [ 94, 43 ], [ 84, 45 ], [ 26, 47 ], [ ...
[ "n,l=map(int,raw_input().split())\na=map(int,raw_input().split())\nfknot=0\nfor i in xrange(n-1):\n if a[i]+a[i+1]>=l:\n fknot=i+1\nif fknot==0:\n print(\"Impossible\")\nelse:\n print(\"Possible\")\n for i in xrange(n-1,fknot,-1):\n print(i)\n for i in xrange(1,fknot):\n print(i)...
n,l=map(int,raw_input().split()) a=map(int,raw_input().split()) fknot=0 for i in xrange(n-1): if a[i]+a[i+1]>=l: fknot=i+1 if fknot==0: print("Impossible") else: print("Possible") for i in xrange(n-1,fknot,-1): print(i) for i in xrange(1,fknot): print(i) print(fknot)
[ 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, 14, 2, 13, 17, 4, 13, 17, ...
[ [ 95, 2 ], [ 95, 11 ], [ 92, 13 ], [ 98, 25 ], [ 29, 28 ], [ 90, 32 ], [ 93, 38 ], [ 28, 39 ], [ 93, 41 ], [ 28, 43 ], [ 96, 45 ], [ 86, 47 ], [ 28, 48 ], [ ...
[ "n,l = map(int,input().split())\na = list(map(int,input().split()))\n\nmemo = -1\nfor i in range(n-1):\n if a[i]+a[i+1] >= l:\n memo = i\n\nif memo == -1:\n print(\"Impossible\")\nelse:\n print(\"Possible\")\n for i in range(memo):\n print(i+1)\n for i in range(n-2,memo-1,-1):\n ...
n,l = map(int,input().split()) a = list(map(int,input().split())) memo = -1 for i in range(n-1): if a[i]+a[i+1] >= l: memo = i if memo == -1: print("Impossible") else: print("Possible") for i in range(memo): print(i+1) for i in range(n-2,memo-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, 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, ...
[ [ 117, 2 ], [ 117, 11 ], [ 105, 13 ], [ 114, 25 ], [ 29, 28 ], [ 118, 32 ], [ 106, 37 ], [ 28, 39 ], [ 106, 42 ], [ 28, 43 ], [ 112, 44 ], [ 102, 46 ], [ 28, 47 ]...
[ "# 隣り合う和がL未満ならそもそもimpossible\n# ならば隣り合う和がL以上ならば? -> そこから連続して隣り合うやつをどうやって足しても常にL以上\n\nn, l = map(int, input().split())\na = list(map(int, input().split()))\nidx = 0\nfor i in range(1, n):\n if a[i - 1] + a[i] >= l:\n idx = i\n break\nif idx == 0:\n print(\"Impossible\")\n exit()\n\nprint(\"Pos...
# 隣り合う和がL未満ならそもそもimpossible # ならば隣り合う和がL以上ならば? -> そこから連続して隣り合うやつをどうやって足しても常にL以上 n, l = map(int, input().split()) a = list(map(int, input().split())) idx = 0 for i in range(1, n): if a[i - 1] + a[i] >= l: idx = i break if idx == 0: print("Impossible") exit() print("Possible") ans = [idx] f...
[ 7, 0, 13, 4, 13, 13, 4, 18, 4, 13, 13, 13, 0, 13, 4, 13, 13, 4, 18, 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, 13, 3, 14, 2, 13, 17, 13, ...
[ [ 89, 2 ], [ 89, 11 ], [ 80, 13 ], [ 83, 23 ], [ 92, 26 ], [ 30, 29 ], [ 90, 33 ], [ 81, 39 ], [ 29, 40 ], [ 81, 42 ], [ 29, 44 ], [ 87, 46 ], [ 77, 48 ], [ ...
[ "n,l=map(int,raw_input().split())\na=map(int,raw_input().split())\nans=[]\nf=-1\nfor i in range(n-1):\n if a[i]+a[i+1]>=l:\n f=i\n break\nif f==-1:\n print 'Impossible'\nelse:\n print 'Possible'\n for i in range(f):\n print i+1\n for i in range(n-1,f,-1):\n print i", "n,...
n,l=map(int,raw_input().split()) a=map(int,raw_input().split()) ans=[] f=-1 for i in range(n-1): if a[i]+a[i+1]>=l: f=i break if f==-1: print 'Impossible' else: print 'Possible' for i in range(f): print i+1 for i in range(n-1,f,-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, 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, ...
[ [ 108, 2 ], [ 108, 11 ], [ 96, 13 ], [ 99, 25 ], [ 29, 28 ], [ 103, 32 ], [ 97, 38 ], [ 28, 39 ], [ 97, 41 ], [ 28, 43 ], [ 109, 45 ], [ 105, 47 ], [ 93, 50 ], ...
[ "N, L = map( int, input().split())\nA = list( map( int, input().split()))\nans = \"Impossible\"\nfor i in range(N-1):\n if A[i] + A[i+1] >= L:\n ans = \"Possible\"\n t = i\n break\nif ans == \"Impossible\":\n print(ans)\nelse:\n print(ans)\n for i in range(t):\n print(i+1)\n ...
N, L = map( int, input().split()) A = list( map( int, input().split())) ans = "Impossible" for i in range(N-1): if A[i] + A[i+1] >= L: ans = "Possible" t = i break if ans == "Impossible": print(ans) else: print(ans) for i in range(t): print(i+1) for i in range(N-2,t,-...
[ 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, 2, 13, 17, 14, 2, 2, 18, 13, 13, 18, 13, 2, 13, 17, 13, 0, 13, 2, 18, ...
[ [ 134, 2 ], [ 134, 11 ], [ 15, 14 ], [ 14, 23 ], [ 116, 25 ], [ 131, 28 ], [ 119, 31 ], [ 35, 34 ], [ 135, 38 ], [ 117, 44 ], [ 34, 45 ], [ 117, 47 ], [ 34, 49 ],...
[ "N, L = map(int, input().split())\na = [int(i) for i in input().split()]\n\nmax_k = 0\nmax_p = 0\n\nfor i in range(N-1):\n if a[i]+a[i+1] > max_k:\n max_k = a[i]+a[i+1]\n max_p = i+1\n\nif max_k < L:\n print('Impossible')\n exit()\nelse:\n print('Possible')\n\nfor i in range(1, N):\n if...
N, L = map(int, input().split()) a = [int(i) for i in input().split()] max_k = 0 max_p = 0 for i in range(N-1): if a[i]+a[i+1] > max_k: max_k = a[i]+a[i+1] max_p = i+1 if max_k < L: print('Impossible') exit() else: print('Possible') for i in range(1, N): if i == max_p: br...
[ 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, 14, 2, 13, 17, 4, 13, 17, ...
[ [ 103, 2 ], [ 103, 11 ], [ 100, 13 ], [ 97, 25 ], [ 29, 28 ], [ 95, 32 ], [ 101, 38 ], [ 28, 39 ], [ 101, 41 ], [ 28, 43 ], [ 104, 45 ], [ 91, 47 ], [ 28, 48 ], ...
[ "n,l = map(int,input().split())\nal = list(map(int,input().split()))\n\ntarget = -1\nfor i in range(n-1):\n if al[i] + al[i+1] >= l:\n target = i\n\nif target == -1:\n print(\"Impossible\")\n exit()\nelse:\n print(\"Possible\")\n for i in range(target):\n print(i+1)\n for i in range(...
n,l = map(int,input().split()) al = list(map(int,input().split())) target = -1 for i in range(n-1): if al[i] + al[i+1] >= l: target = i if target == -1: print("Impossible") exit() else: print("Possible") for i in range(target): print(i+1) for i in range(n-1, target+1, -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, 4, 13, 17, 41, 28, 13, 4, 13, 17, 2, ...
[ [ 100, 2 ], [ 100, 11 ], [ 94, 13 ], [ 88, 25 ], [ 29, 28 ], [ 98, 32 ], [ 95, 38 ], [ 28, 39 ], [ 95, 41 ], [ 28, 43 ], [ 101, 45 ], [ 52, 51 ], [ 28, 56 ], [ ...
[ "n,l=map(int,input().split())\na=list(map(int,input().split()))\nf=True\nfor i in range(n-1):\n if a[i]+a[i+1]>=l:\n print(\"Possible\")\n print(\"\\n\".join([str(j) for j in range(1,i+1)]+[str(j) for j in range(n-1,i+1,-1)]+[str(i+1)]))\n f=False\n break\nif f:\n print(\"Impossible\")", "n,l=map(in...
n,l=map(int,input().split()) a=list(map(int,input().split())) f=True for i in range(n-1): if a[i]+a[i+1]>=l: print("Possible") print("\n".join([str(j) for j in range(1,i+1)]+[str(j) for j in range(n-1,i+1,-1)]+[str(i+1)])) f=False break if f: print("Impossible")
[ 7, 15, 13, 12, 13, 41, 28, 13, 4, 13, 13, 4, 2, 39, 13, 13, 12, 13, 23, 13, 23, 13, 23, 13, 41, 28, 13, 4, 13, 13, 4, 13, 12, 13, 23, 13, 23, 13, 23, 13, 23, 13, 41, 28, 13, 4, 13, 13, 4, 13, 12, 13, 23, 13, ...
[ [ 8, 7 ], [ 19, 19 ], [ 21, 21 ], [ 23, 23 ], [ 27, 26 ], [ 35, 35 ], [ 37, 37 ], [ 39, 39 ], [ 41, 41 ], [ 45, 44 ], [ 53, 53 ], [ 55, 55 ], [ 57, 57 ], [ ...
[ "# -*- coding: utf-8 -*-\n\nimport sys\n\ndef input(): return sys.stdin.readline().strip()\ndef list2d(a, b, c): return [[c] * b for i in range(a)]\ndef list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]\ndef list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for ...
# -*- coding: utf-8 -*- import sys def input(): return sys.stdin.readline().strip() def list2d(a, b, c): return [[c] * b for i in range(a)] def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)] def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a...
[ 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, 0, 13, 4, 13, 13, 0, 13, 17, 13, 2, 13, 17, 0, 13, 39, 0, 13, 17, 0, 13, 17, 28, 13, 4, 13, 2, 13, 17, 14, 40, ...
[ [ 125, 2 ], [ 125, 13 ], [ 137, 15 ], [ 116, 27 ], [ 138, 30 ], [ 131, 32 ], [ 110, 34 ], [ 120, 36 ], [ 113, 39 ], [ 134, 42 ], [ 128, 45 ], [ 49, 48 ], [ 120, 52 ...
[ "N, L = list(map(int, input().split()))\nAs = list(map(int, input().split()))\n\nsumL = sum(As)\n\nl,r = 0, N-1\nans = []\ncnt = 0\n\ncenter = -1\nfor i in range(N-1):\n if As[i]+As[i+1]>=L:\n center = i+1\n break\nif center < 0:\n print('Impossible')\nelse:\n print('Possible')\n for i in ...
N, L = list(map(int, input().split())) As = list(map(int, input().split())) sumL = sum(As) l,r = 0, N-1 ans = [] cnt = 0 center = -1 for i in range(N-1): if As[i]+As[i+1]>=L: center = i+1 break if center < 0: print('Impossible') else: print('Possible') for i in range(center-1): ...
[ 7, 15, 13, 15, 13, 0, 13, 18, 13, 13, 0, 13, 12, 4, 13, 4, 13, 0, 13, 12, 4, 13, 4, 13, 13, 4, 18, 4, 18, 13, 13, 13, 0, 13, 12, 4, 18, 4, 18, 13, 13, 13, 4, 18, 13, 13, 2, 17, 17, 0, 13, 4, 13, 13, 0, 13, ...
[ [ 144, 6 ], [ 138, 11 ], [ 153, 18 ], [ 145, 29 ], [ 156, 33 ], [ 145, 39 ], [ 162, 50 ], [ 154, 52 ], [ 162, 53 ], [ 150, 55 ], [ 154, 61 ], [ 159, 63 ], [ 151, 66...
[ "import sys\nimport numpy as np\n\nstdin = sys.stdin\n\nri = lambda: int(rs())\nrl = lambda: list(map(int, stdin.readline().split())) # applies to only numbers\nrs = lambda: stdin.readline().rstrip() # ignore trailing spaces\nsys.setrecursionlimit(10 ** 7)\n\nN, L = rl()\nA = np.array(rl())\ncouple = A[:-1] + A[1:...
import sys import numpy as np stdin = sys.stdin ri = lambda: int(rs()) rl = lambda: list(map(int, stdin.readline().split())) # applies to only numbers rs = lambda: stdin.readline().rstrip() # ignore trailing spaces sys.setrecursionlimit(10 ** 7) N, L = rl() A = np.array(rl()) couple = A[:-1] + A[1:] if couple.max()...
[ 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, 17, ...
[ [ 87, 4 ], [ 87, 13 ], [ 93, 15 ], [ 81, 27 ], [ 31, 30 ], [ 85, 34 ], [ 94, 40 ], [ 30, 41 ], [ 94, 43 ], [ 30, 45 ], [ 88, 47 ], [ 90, 49 ], [ 30, 50 ], [ ...
[ "import sys\nN, 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\nif last == -1:\n print('Impossible')\n sys.exit()\n\nprint('Possible')\nfor i in range(last): print(i+1)\nfor i in range(N-1, last...
import sys 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') sys.exit() print('Possible') for i in range(last): print(i+1) for i in range(N-1, last, -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, 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 ], [ 101, 13 ], [ 107, 25 ], [ 29, 28 ], [ 99, 32 ], [ 102, 38 ], [ 28, 39 ], [ 102, 41 ], [ 28, 43 ], [ 105, 45 ], [ 95, 47 ], [ 28, 48 ], ...
[ "n,l=map(int,input().split())\na=list(map(int,input().split()))\nf=-1\nfor i in range(n-1):\n\tif a[i]+a[i+1]>=l:\n\t\tf=i\n\t\tbreak\nif f==-1:\n\tprint(\"Impossible\")\n\texit()\nprint(\"Possible\")\nfor i in range(n-1):\n\tif i<f:\n\t\tprint(i+1)\n\telif i>f:\n\t\tprint(n-i+f)\nprint(f+1)", "n,l=map(int,input(...
n,l=map(int,input().split()) a=list(map(int,input().split())) f=-1 for i in range(n-1): if a[i]+a[i+1]>=l: f=i break if f==-1: print("Impossible") exit() print("Possible") for i in range(n-1): if i<f: print(i+1) elif i>f: print(n-i+f) print(f+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, ...
[ [ 95, 2 ], [ 95, 11 ], [ 89, 13 ], [ 83, 25 ], [ 29, 28 ], [ 87, 32 ], [ 90, 38 ], [ 28, 39 ], [ 90, 41 ], [ 28, 43 ], [ 96, 45 ], [ 92, 47 ], [ 28, 48 ], [ ...
[ "N, L = map(int, input().split())\na = list(map(int, input().split()))\n\nidx = -1\nfor i in range(N - 1):\n if a[i] + a[i + 1] >= L:\n idx = i\n break\n\nif idx == -1:\n print(\"Impossible\")\nelse:\n print(\"Possible\")\n for i in range(idx):\n print(i + 1)\n for i in range(N - 1, idx, -1):\n pri...
N, L = map(int, input().split()) a = list(map(int, input().split())) idx = -1 for i in range(N - 1): if a[i] + a[i + 1] >= L: idx = i break if idx == -1: print("Impossible") else: print("Possible") for i in range(idx): print(i + 1) for i in range(N - 1, idx, -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, 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, ...
[ [ 99, 2 ], [ 99, 11 ], [ 93, 13 ], [ 96, 25 ], [ 29, 28 ], [ 100, 32 ], [ 94, 38 ], [ 28, 39 ], [ 94, 41 ], [ 28, 43 ], [ 91, 45 ], [ 87, 47 ], [ 28, 48 ], [ ...
[ "n,l=map(int, input().split())\na=list(map(int, input().split()))\n\nf = -1\nfor i in range(n-1):\n if a[i] + a[i+1] >= l:\n f = i\n break\nif f == -1:\n print('Impossible')\n exit()\nprint('Possible')\nfor i in range(1,f+1,1):\n print(i)\nfor i in range(n-1,f,-1):\n print(i)", "n,l=m...
n,l=map(int, input().split()) a=list(map(int, input().split())) f = -1 for i in range(n-1): if a[i] + a[i+1] >= l: f = i break if f == -1: print('Impossible') exit() print('Possible') for i in range(1,f+1,1): print(i) for i in range(n-1,f,-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, 14, 2, 13, 17, 14, 2, 2, 18, 13, 17, 18, 13, 17, 13, 4, 13, 17, 4, 13, 17, 4, 13, 17, 0, 13, 17, 28, 13, 4, 13, 2, 13, ...
[ [ 126, 2 ], [ 126, 11 ], [ 135, 13 ], [ 127, 26 ], [ 136, 32 ], [ 136, 35 ], [ 124, 37 ], [ 120, 48 ], [ 52, 51 ], [ 127, 55 ], [ 136, 61 ], [ 51, 62 ], [ 136, 64 ...
[ "n, l = map(int, input().split())\na = list(map(int, input().split()))\n\nif n == 2:\n\tif a[0] + a[1] < l:\n\t\tprint(\"Impossible\")\n\telse:\n\t\tprint(\"Possible\")\n\t\tprint(1)\n\nelse:\n\tnagai = 0\n\tfor i in range(n - 1):\n\t\tif a[i] + a[i + 1] > nagai:\n\t\t\tnagai = a[i] + a[i + 1]\n\t\t\tnagai_index = ...
n, l = map(int, input().split()) a = list(map(int, input().split())) if n == 2: if a[0] + a[1] < l: print("Impossible") else: print("Possible") print(1) else: nagai = 0 for i in range(n - 1): if a[i] + a[i + 1] > nagai: nagai = a[i] + a[i + 1] nagai_index = i + 1 if nagai < l: print("Impossible"...
[ 7, 15, 13, 15, 13, 15, 15, 13, 15, 0, 13, 18, 13, 13, 4, 13, 2, 17, 17, 12, 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, 0, 13, 18, 13, 17, 0, 13, 17, 2...
[ [ 123, 10 ], [ 23, 22 ], [ 124, 29 ], [ 23, 31 ], [ 35, 34 ], [ 124, 38 ], [ 34, 43 ], [ 46, 45 ], [ 49, 48 ], [ 45, 50 ], [ 54, 53 ], [ 45, 61 ], [ 48, 67 ], [...
[ "import math\n#import numpy as np\nimport queue\nfrom collections import deque,defaultdict\nimport heapq as hpq\nfrom sys import stdin,setrecursionlimit\n#from scipy.sparse.csgraph import dijkstra\n#from scipy.sparse import csr_matrix\nipt = stdin.readline\nsetrecursionlimit(10**7)\n\ndef main():\n n,l = map(int...
import math #import numpy as np import queue from collections import deque,defaultdict import heapq as hpq from sys import stdin,setrecursionlimit #from scipy.sparse.csgraph import dijkstra #from scipy.sparse import csr_matrix ipt = stdin.readline setrecursionlimit(10**7) def main(): n,l = map(int,ipt().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, 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, 4, 13, 17, 4, 13, 4, ...
[ [ 99, 2 ], [ 99, 11 ], [ 90, 13 ], [ 96, 25 ], [ 29, 28 ], [ 94, 32 ], [ 91, 38 ], [ 28, 39 ], [ 91, 41 ], [ 28, 43 ], [ 100, 45 ], [ 102, 47 ], [ 28, 48 ], [ ...
[ "n,l= map(int,input().split())\na= list(map(int,input().split()))\nrh=-1\nfor i in range(n-1):\n if a[i]+a[i+1]>=l:\n rh=i\n break\nelse:\n print('Impossible')\n exit()\nprint('Possible')\nif rh>0:\n for i in range(rh):print(i+1)\nif rh+1<n:\n for i in range(n-1,rh+1,-1):print(i)\nprint...
n,l= map(int,input().split()) a= list(map(int,input().split())) rh=-1 for i in range(n-1): if a[i]+a[i+1]>=l: rh=i break else: print('Impossible') exit() print('Possible') if rh>0: for i in range(rh):print(i+1) if rh+1<n: for i in range(n-1,rh+1,-1):print(i) print(rh+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, 17, 0, 13, 13, 3, ...
[ [ 106, 2 ], [ 106, 11 ], [ 97, 13 ], [ 103, 25 ], [ 109, 28 ], [ 32, 31 ], [ 101, 35 ], [ 98, 41 ], [ 31, 42 ], [ 98, 44 ], [ 31, 46 ], [ 107, 48 ], [ 94, 50 ], ...
[ "\nN,L = map(int,input().split())\n\na = list(map(int,input().split()))\n\nflag = False\nable = 0\nfor i in range(N-1):\n\n if a[i] + a[i+1] >= L:\n flag = True\n able = i\n break\n\nif flag:\n\n print (\"Possible\")\n\n for i in range(able):\n print (i+1)\n\n for i in range(...
N,L = map(int,input().split()) a = list(map(int,input().split())) flag = False able = 0 for i in range(N-1): if a[i] + a[i+1] >= L: flag = True able = i break if flag: print ("Possible") for i in range(able): print (i+1) for i in range(N-1-able): print (N-...
[ 7, 15, 13, 0, 13, 18, 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, 13, 0, 13, 17, 28, 13, 4, 13, 2, 13, 17, 14, 40, 2, 18, 13, 13, 18, 13, 2...
[ [ 102, 4 ], [ 16, 15 ], [ 103, 22 ], [ 16, 24 ], [ 27, 26 ], [ 103, 35 ], [ 39, 38 ], [ 42, 41 ], [ 15, 45 ], [ 26, 51 ], [ 41, 52 ], [ 26, 54 ], [ 41, 56 ], [ ...
[ "import sys\ninput = sys.stdin.buffer.readline\n\ndef main():\n N,M = map(int,input().split())\n a = list(map(int,input().split()))\n use = -1\n for i in range(N-1):\n if a[i]+a[i+1] >= M:\n use = i\n break\n \n if use == -1:\n print(\"Impossible\")\n else:\n...
import sys input = sys.stdin.buffer.readline def main(): N,M = map(int,input().split()) a = list(map(int,input().split())) use = -1 for i in range(N-1): if a[i]+a[i+1] >= M: use = i break if use == -1: print("Impossible") else: print("Possibl...
[ 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, 2, 18, 13, 17, 18, 13, 17, 0, 13, 17, 28, 13, 4, 13, 17, 2, 13, 17, 0, 13, 2, 18, ...
[ [ 4, 3 ], [ 3, 12 ], [ 127, 14 ], [ 127, 16 ], [ 20, 19 ], [ 19, 28 ], [ 133, 30 ], [ 118, 33 ], [ 134, 36 ], [ 134, 39 ], [ 112, 42 ], [ 46, 45 ], [ 116, 50 ], ...
[ "n,l = [int(i) for i in input().split()]\na=[int(i) for i in input().split()]\n#b=[int(i) for i in input().split()]\n\nmax_len = a[0]+a[1]\nmax_joint = 1\n\nfor i in range(1,n-1):\n len = a[i] + a[i+1]\n if len > max_len:\n max_len = len\n max_joint = i+1\n\n\nif max_len < l:\n print(\"Im...
n,l = [int(i) for i in input().split()] a=[int(i) for i in input().split()] #b=[int(i) for i in input().split()] max_len = a[0]+a[1] max_joint = 1 for i in range(1,n-1): len = a[i] + a[i+1] if len > max_len: max_len = len max_joint = i+1 if max_len < l: print("Impossible") exit()...
[ 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, 13, 18, 13, 2, 13, 17, 13, 0, 13, 2, 13, 17, 3, 14, 2, 13, 17, 4, ...
[ [ 99, 2 ], [ 99, 11 ], [ 90, 13 ], [ 96, 25 ], [ 29, 28 ], [ 94, 32 ], [ 91, 37 ], [ 28, 38 ], [ 91, 40 ], [ 28, 42 ], [ 100, 44 ], [ 87, 46 ], [ 28, 48 ], [ ...
[ "n,l=map(int,input().split())\nA=list(map(int,input().split()))\nadd=0\nfor i in range(1,n):\n if A[i]+A[i-1]>=l:\n add=i+1\n break\nif add==0:print(\"Impossible\");exit()\nprint(\"Possible\")\nfor i in range(1,add-1):print(i)\nfor i in [j for j in range(add,n)][::-1]:print(i)\nprint(add-1)", "n,...
n,l=map(int,input().split()) A=list(map(int,input().split())) add=0 for i in range(1,n): if A[i]+A[i-1]>=l: add=i+1 break if add==0:print("Impossible");exit() print("Possible") for i in range(1,add-1):print(i) for i in [j for j in range(add,n)][::-1]:print(i) print(add-1)
[ 7, 15, 15, 12, 13, 0, 13, 4, 13, 13, 4, 18, 4, 18, 13, 13, 13, 13, 0, 13, 4, 13, 13, 4, 18, 4, 18, 13, 13, 13, 4, 13, 17, 13, 28, 13, 4, 13, 2, 13, 17, 14, 40, 2, 18, 13, 13, 18, 13, 2, 13, 17, 13, 0, 13, 2...
[ [ 7, 6 ], [ 7, 17 ], [ 20, 19 ], [ 6, 33 ], [ 36, 35 ], [ 6, 39 ], [ 19, 45 ], [ 35, 46 ], [ 19, 48 ], [ 35, 50 ], [ 17, 52 ], [ 55, 54 ], [ 35, 61 ], [ 6, ...
[ "from sys import stdin, stdout\nfrom itertools import repeat\ndef main():\n n, l = map(int, stdin.readline().split())\n a = map(int, stdin.read().split(), repeat(10, n))\n for i in xrange(n - 1):\n\tif a[i] + a[i+1] >= l:\n ans = range(1, i + 1) + range(n - 1, i + 1, -1) + [i + 1]\n s...
from sys import stdin, stdout from itertools import repeat def main(): n, l = map(int, stdin.readline().split()) a = map(int, stdin.read().split(), repeat(10, n)) for i in xrange(n - 1): if a[i] + a[i+1] >= l: ans = range(1, i + 1) + range(n - 1, i + 1, -1) + [i + 1] stdout.write('P...
[ 7, 15, 15, 15, 13, 15, 15, 13, 15, 13, 15, 13, 15, 13, 15, 13, 0, 13, 4, 18, 13, 13, 4, 18, 13, 13, 2, 17, 17, 12, 13, 29, 4, 18, 4, 13, 13, 12, 13, 29, 4, 13, 13, 4, 18, 4, 13, 13, 12, 13, 29, 4, 13, 4, 13, ...
[ [ 208, 17 ], [ 60, 59 ], [ 59, 68 ], [ 199, 72 ], [ 178, 77 ], [ 193, 84 ], [ 170, 86 ], [ 193, 87 ], [ 187, 89 ], [ 212, 91 ], [ 184, 93 ], [ 196, 96 ], [ 100, 99 ...
[ "from heapq import heappush, heappop\nfrom collections import deque,defaultdict,Counter\nimport itertools\nfrom itertools import permutations\nimport sys\nimport bisect\nimport string\nimport math\nimport time\nts=time.time()\nsys.setrecursionlimit(10**6)\ndef SI():\n return input().split()\ndef MI():\n retur...
from heapq import heappush, heappop from collections import deque,defaultdict,Counter import itertools from itertools import permutations import sys import bisect import string import math import time ts=time.time() sys.setrecursionlimit(10**6) def SI(): return input().split() def MI(): return map(int,input().s...
[ 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, ...
[ [ 87, 2 ], [ 87, 11 ], [ 96, 13 ], [ 90, 25 ], [ 29, 28 ], [ 88, 32 ], [ 97, 37 ], [ 28, 39 ], [ 97, 42 ], [ 28, 43 ], [ 85, 44 ], [ 93, 46 ], [ 28, 47 ], [ ...
[ "N, L = map(int, input().split())\nAs = list(map(int, input().split()))\n\ni = 0\n\nfor j in range(1,N):\n if As[j-1] + As[j] >= L:\n i = j\n break\n \nif i == 0:\n print('Impossible')\nelse:\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, L = map(int, input().split()) As = list(map(int, input().split())) i = 0 for j in range(1,N): if As[j-1] + As[j] >= L: i = j break if i == 0: print('Impossible') else: print('Possible') for j in range(1,i): print(j) for j in range(N-1,i,-1): print(j) print(i)
[ 7, 12, 13, 41, 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, 29, 2, 13, 17, 29, 17, 0, 13, 4, 13,...
[ [ 6, 5 ], [ 6, 14 ], [ 17, 16 ], [ 29, 28 ], [ 5, 32 ], [ 16, 38 ], [ 28, 39 ], [ 16, 41 ], [ 28, 43 ], [ 14, 45 ], [ 28, 48 ], [ 92, 53 ], [ 90, 55 ], [ 63...
[ "def solve():\n global N, L\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 return i+1\n return False\nans = solve()\nif ans:\n print('Possible')\n for i in range(1, ans):\n print(i)\n for i in ra...
def solve(): global N, L 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: return i+1 return False ans = solve() if ans: print('Possible') for i in range(1, ans): print(i) for i in range(N-1, ans, -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, 39, 13, 13, 4, 13, 4, 13, 13, 18, 13, 39, 17, 14, 40, 2, 13, 13, 13, 0, 13, 13, 3, 14, 2, 13, 17, 4, ...
[ [ 103, 2 ], [ 103, 11 ], [ 91, 13 ], [ 97, 25 ], [ 92, 36 ], [ 92, 38 ], [ 104, 46 ], [ 106, 48 ], [ 107, 53 ], [ 98, 53 ], [ 100, 64 ], [ 95, 79 ], [ 101, 86 ], ...
[ "N,L = map(int,input().split())\nA = list(map(int,input().split()))\n\nlast = -1\nfor i,(a,b) in enumerate(zip(A,A[1:])):\n if a+b >= L:\n last = i\n break\nif last < 0:\n print('Impossible')\n exit()\nprint('Possible')\n\nans = list(range(1,i+1)) + list(range(N-1,i,-1))\nprint(*ans, sep='\\n...
N,L = map(int,input().split()) A = list(map(int,input().split())) last = -1 for i,(a,b) in enumerate(zip(A,A[1:])): if a+b >= L: last = i break if last < 0: print('Impossible') exit() print('Possible') ans = list(range(1,i+1)) + list(range(N-1,i,-1)) 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, 2, 13, 17, 14, 40, 13, 2, 18, 13, 13, 18, 13, 2, 13, 17, 0, 13, 13, 3, 14, 2, 13, 17, 4, 13, ...
[ [ 93, 2 ], [ 93, 11 ], [ 96, 13 ], [ 87, 25 ], [ 29, 28 ], [ 94, 32 ], [ 91, 36 ], [ 97, 39 ], [ 28, 40 ], [ 97, 42 ], [ 28, 44 ], [ 99, 47 ], [ 28, 48 ], [ ...
[ "n, l = map(int, input().split())\na = list(map(int, input().split()))\n\natom = -1\nfor i in range(n-1):\n if l <= a[i] + a[i+1]:\n atom = i\n break\n \nif atom < 0:\n print('Impossible')\nelse:\n print('Possible')\n for i in range(atom):\n print(i+1)\n for i in range(n-a...
n, l = map(int, input().split()) a = list(map(int, input().split())) atom = -1 for i in range(n-1): if l <= a[i] + a[i+1]: atom = i break if atom < 0: print('Impossible') else: print('Possible') for i in range(atom): print(i+1) for i in range(n-atom-1): prin...
[ 7, 15, 13, 0, 13, 18, 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, 13, 28, 13, 4, 13, 2, 13, 17, 14, 40, 2, 18, 13, 13, 18, 13, 2, 13, 17, 1...
[ [ 99, 4 ], [ 16, 15 ], [ 100, 22 ], [ 16, 24 ], [ 27, 26 ], [ 100, 35 ], [ 39, 38 ], [ 15, 42 ], [ 26, 48 ], [ 38, 49 ], [ 26, 51 ], [ 38, 53 ], [ 24, 55 ], [ ...
[ "import sys\n#input = sys.stdin.readline\ninput = sys.stdin.buffer.readline\n\n# mod=10**9+7\n# rstrip().decode('utf-8')\n# map(int,input().split())\n#import numpy as np\n\n\ndef main():\n\tn,l=map(int,input().split())\n\ta=list(map(int,input().split()))\n\n\tfor i in range(n-1):\n\t\tif a[i]+a[i+1]>=l:\n\t\t\tbrea...
import sys #input = sys.stdin.readline input = sys.stdin.buffer.readline # mod=10**9+7 # rstrip().decode('utf-8') # map(int,input().split()) #import numpy as np def main(): 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: 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, 17, 13, 14, 40, 2, 18, 13, 13, 18, 13, 2, 13, 17, 13, 0, 13, 17, 0, 13, 13, 14, 13,...
[ [ 104, 2 ], [ 104, 11 ], [ 101, 13 ], [ 92, 25 ], [ 98, 28 ], [ 32, 31 ], [ 105, 35 ], [ 102, 40 ], [ 31, 41 ], [ 102, 43 ], [ 31, 45 ], [ 90, 47 ], [ 95, 49 ], ...
[ "N, L = map(int,input().split())\na = list(map(int,input().split()))\nt = True\nkey_number = -1\nfor i in range(1,N):\n if a[i] + a[i-1] >= L:\n t = False\n key_number = i\n\nif t:\n print(\"Impossible\")\nelse:\n print(\"Possible\")\n for ans in range(1,key_number):\n print(ans)\n ...
N, L = map(int,input().split()) a = list(map(int,input().split())) t = True key_number = -1 for i in range(1,N): if a[i] + a[i-1] >= L: t = False key_number = i if t: print("Impossible") else: print("Possible") for ans in range(1,key_number): print(ans) for ans in range(N-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, 4, 13, 17, 28, 13, 4, 13, 17, 13, 4, 13, 13, 28, 13...
[ [ 78, 2 ], [ 78, 11 ], [ 81, 13 ], [ 26, 25 ], [ 76, 29 ], [ 82, 34 ], [ 25, 36 ], [ 82, 39 ], [ 25, 40 ], [ 79, 41 ], [ 47, 46 ], [ 25, 50 ], [ 46, 53 ], [ ...
[ "N, L = map(int, input().split())\nAs = list(map(int, input().split()))\n\nfor iKnot in range(1, N):\n if As[iKnot - 1] + As[iKnot] >= L:\n print('Possible')\n for i in range(1, iKnot):\n print(i)\n for i in reversed(range(iKnot + 1, N)):\n print(i)\n print(iKnot...
N, L = map(int, input().split()) As = list(map(int, input().split())) for iKnot in range(1, N): if As[iKnot - 1] + As[iKnot] >= L: print('Possible') for i in range(1, iKnot): print(i) for i in reversed(range(iKnot + 1, N)): print(i) print(iKnot) 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, 17, 28, 13, 4, 13, 17, 13, 14, 40, 2, 18, 13, 2, 13, 17, 18, 13, 13, 13, 0, 13, 2, 13, 17, 3, 14, 2, 13, 17, 4, ...
[ [ 104, 2 ], [ 104, 11 ], [ 95, 13 ], [ 98, 25 ], [ 29, 28 ], [ 102, 32 ], [ 96, 37 ], [ 28, 39 ], [ 96, 42 ], [ 28, 43 ], [ 105, 44 ], [ 92, 46 ], [ 28, 48 ], [...
[ "N,L = map(int, input().split())\nA=list(map(int, input().split()))\nchoose = -1\nfor i in range(1, N):\n if A[i - 1] + A[i] >= L:\n choose = i - 1\n break\nif choose == -1:\n print('Impossible')\nelse:\n print('Possible')\n for i in range(0, choose):\n print(i + 1)\n for i in ra...
N,L = map(int, input().split()) A=list(map(int, input().split())) choose = -1 for i in range(1, N): if A[i - 1] + A[i] >= L: choose = i - 1 break if choose == -1: print('Impossible') else: print('Possible') for i in range(0, choose): print(i + 1) for i in range(N - 1, choose ...
[ 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, 15, 13, 0, 13, 4, 13, 13, 4, 18, 4, 13, 13, 13, 31, 13, 41, 28, 13, 13, 4, 13, 13, 18, 13, 3...
[ [ 123, 4 ], [ 141, 13 ], [ 138, 22 ], [ 144, 33 ], [ 124, 40 ], [ 144, 42 ], [ 144, 43 ], [ 126, 61 ], [ 147, 67 ], [ 127, 70 ], [ 132, 72 ], [ 127, 75 ], [ 148, 77...
[ "import sys\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\nimport itertools\n\n# 和がL以上の2つをつなぐ\n# 和がL以上のものが1つ作れたら、その周辺だけ処理していけばよい\n\nN,L,*A = map(int,read().split())\n\nS = [0] + [x+y for x,y in zip(A,A[1:])]\nM = max(S)\ni = S.index(M)\n\nif M < L:\n ...
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines import itertools # 和がL以上の2つをつなぐ # 和がL以上のものが1つ作れたら、その周辺だけ処理していけばよい N,L,*A = map(int,read().split()) S = [0] + [x+y for x,y in zip(A,A[1:])] M = max(S) i = S.index(M) if M < L: print('Impossible') ...
[ 7, 0, 13, 12, 4, 13, 4, 13, 13, 4, 18, 4, 13, 13, 0, 13, 4, 13, 13, 0, 13, 4, 13, 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, 13, 3, 14, 13, 4, 13, 17, ...
[ [ 111, 2 ], [ 117, 15 ], [ 112, 17 ], [ 117, 18 ], [ 99, 20 ], [ 112, 22 ], [ 93, 24 ], [ 28, 27 ], [ 118, 31 ], [ 100, 36 ], [ 27, 38 ], [ 100, 41 ], [ 27, 42 ],...
[ "ai = lambda: list(map(int, input().split()))\n\nn,l = ai()\na = ai()\n\nf = 0\nfor i in range(1,n):\n if a[i-1]+a[i] >= l:\n f = 1\n key = i\n break\nif f:\n print('Possible')\n b = list(range(n))\n c = b[1:key]\n c += b[-1:key:-1]\n c += [key]\n print(*c, sep='\\n')\nelse...
ai = lambda: list(map(int, input().split())) n,l = ai() a = ai() f = 0 for i in range(1,n): if a[i-1]+a[i] >= l: f = 1 key = i break if f: print('Possible') b = list(range(n)) c = b[1:key] c += b[-1:key:-1] c += [key] print(*c, sep='\n') 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, 13, 4, 13, 4, 13, 18, 13, 39, 17, 18, 13, 39, 17, 14, 2, 13, 4, 13, 13, 0, 13, 4, 13, 13, ...
[ [ 101, 2 ], [ 101, 11 ], [ 92, 13 ], [ 107, 25 ], [ 107, 28 ], [ 93, 38 ], [ 93, 42 ], [ 108, 47 ], [ 105, 47 ], [ 104, 52 ], [ 95, 57 ], [ 62, 61 ], [ 96, 66 ], ...
[ "N, L = map(int, input().split())\na = list(map(int, input().split()))\nmax_value = max_value_index = 0\nfor index, i in enumerate(zip(a[:-1], a[1:])):\n if max_value < sum(i):\n max_value = sum(i)\n max_value_index = index\n\nprint(\"Possible\\n\" + \"\\n\".join([str(i) for i in range(1, max_value...
N, L = map(int, input().split()) a = list(map(int, input().split())) max_value = max_value_index = 0 for index, i in enumerate(zip(a[:-1], a[1:])): if max_value < sum(i): max_value = sum(i) max_value_index = index print("Possible\n" + "\n".join([str(i) for i in range(1, max_value_index + 1)] + [str...
[ 7, 15, 13, 0, 13, 39, 17, 17, 17, 0, 13, 17, 0, 13, 18, 13, 13, 0, 13, 12, 4, 13, 13, 4, 18, 4, 13, 13, 0, 13, 12, 4, 13, 4, 13, 0, 13, 17, 12, 13, 0, 13, 4, 13, 13, 0, 13, 4, 13, 28, 13, 4, 13, 2, 4, 13, ...
[ [ 200, 4 ], [ 215, 10 ], [ 209, 13 ], [ 201, 15 ], [ 216, 16 ], [ 203, 18 ], [ 233, 29 ], [ 204, 34 ], [ 206, 36 ], [ 42, 41 ], [ 204, 43 ], [ 42, 44 ], [ 47, 46 ...
[ "import sys\n\ninput_methods=['clipboard','file','key']\nusing_method=0\ninput_method=input_methods[using_method]\n\nIN=lambda : map(int, input().split())\nLIN=lambda : list(IN())\nmod=1000000007\n\n#+++++\n\ndef main():\n\t#a = int(input())\n\tn , l = IN()\n\t#s = input()\n\tal = LIN()\n\tfor i in range(len(al)-1)...
import sys input_methods=['clipboard','file','key'] using_method=0 input_method=input_methods[using_method] IN=lambda : map(int, input().split()) LIN=lambda : list(IN()) mod=1000000007 #+++++ def main(): #a = int(input()) n , l = IN() #s = input() al = LIN() for i in range(len(al)-1): if al[i]+al[i+1] >= l: ...
[ 7, 0, 13, 4, 13, 13, 4, 18, 4, 13, 13, 13, 0, 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, 13, 13, 28, 13,...
[ [ 77, 2 ], [ 77, 11 ], [ 83, 13 ], [ 86, 23 ], [ 27, 26 ], [ 78, 30 ], [ 84, 36 ], [ 26, 37 ], [ 84, 39 ], [ 26, 41 ], [ 75, 43 ], [ 80, 45 ], [ 26, 46 ], [ ...
[ "n, k = map(int, raw_input().split())\nl = map(int, raw_input().split())\nind = -1\nfor i in range(n - 1):\n\tif l[i] + l[i + 1] >= k:\n\t\tind = i\n\t\tbreak\nif ind == -1:\n\tprint \"Impossible\"\nelse:\n\tprint \"Possible\"\n\tfor i in range(1, ind + 1):\n\t\tprint i \n\tfor i in range(n - 1, ind, -1):\n\t\tprin...
n, k = map(int, raw_input().split()) l = map(int, raw_input().split()) ind = -1 for i in range(n - 1): if l[i] + l[i + 1] >= k: ind = i break if ind == -1: print "Impossible" else: print "Possible" for i in range(1, ind + 1): print i for i in range(n - 1, ind, -1): print i
[ 7, 12, 13, 0, 13, 4, 13, 13, 14, 2, 13, 13, 0, 13, 13, 13, 13, 14, 2, 40, 13, 17, 40, 17, 13, 4, 13, 17, 14, 2, 17, 13, 4, 13, 17, 0, 13, 2, 2, 13, 13, 17, 14, 2, 2, 13, 17, 17, 4, 13, 17, 4, 13, 17, 29, 12...
[ [ 5, 4 ], [ 5, 7 ], [ 7, 10 ], [ 4, 11 ], [ 14, 13 ], [ 7, 14 ], [ 16, 15 ], [ 13, 16 ], [ 4, 16 ], [ 13, 20 ], [ 4, 20 ], [ 15, 24 ], [ 7, 24 ], [ 13, ...
[ "def examA():\n a, b = LI()\n if b<a:\n a,b = b,a\n if a<=0 and 0<=b:\n print(\"Zero\")\n elif 0<a:\n print(\"Positive\")\n else:\n judge = b-a+1\n if judge%2==0:\n print(\"Positive\")\n else:\n print(\"Negative\")\n return\n\ndef exa...
def examA(): a, b = LI() if b<a: a,b = b,a if a<=0 and 0<=b: print("Zero") elif 0<a: print("Positive") else: judge = b-a+1 if judge%2==0: print("Positive") else: print("Negative") return def examB(): N, M = LI() fla...
[ 7, 0, 13, 4, 13, 13, 4, 18, 4, 13, 13, 13, 0, 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, 13, 28, 13, 4, 13, 13, 13, 2, 13, 17, 28, 13, 4, 13, 2,...
[ [ 77, 2 ], [ 77, 11 ], [ 74, 13 ], [ 24, 23 ], [ 78, 27 ], [ 75, 33 ], [ 23, 34 ], [ 75, 36 ], [ 23, 38 ], [ 72, 40 ], [ 44, 43 ], [ 23, 46 ], [ 43, 49 ], [ ...
[ "N,L = map(int, raw_input().split())\na = map(int, raw_input().split())\n\nfor 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-2,i,-1):\n print j+1\n print i+1\n break\nelse:\n print \"Impos...
N,L = map(int, raw_input().split()) a = map(int, raw_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-2,i,-1): print j+1 print i+1 break else: print "Impossible"
[ 7, 0, 13, 4, 13, 13, 4, 18, 4, 13, 13, 13, 0, 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, 13, 13, 28, 13,...
[ [ 80, 2 ], [ 80, 11 ], [ 86, 13 ], [ 83, 23 ], [ 27, 26 ], [ 81, 30 ], [ 87, 36 ], [ 26, 37 ], [ 87, 39 ], [ 26, 41 ], [ 75, 43 ], [ 77, 45 ], [ 26, 46 ], [ ...
[ "N, L = map(int, raw_input().split())\nA = map(int, raw_input().split())\n\nk = None\nfor i in range(N-1):\n if A[i] + A[i+1] >= L:\n k = i\n break\n \nif k is None:\n print \"Impossible\"\nelse:\n print \"Possible\"\n for j in range(1,k+1):\n print j\n for j in range(N-1, k, ...
N, L = map(int, raw_input().split()) A = map(int, raw_input().split()) k = None for i in range(N-1): if A[i] + A[i+1] >= L: k = i break if k is None: print "Impossible" else: print "Possible" for j in range(1,k+1): print j for j in range(N-1, k, -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, 17, 4, 13, 13, 14, 40, 2, 18, 13, 13, 18, 13, 2, 13, 17, 13...
[ [ 131, 4 ], [ 125, 11 ], [ 132, 18 ], [ 125, 20 ], [ 137, 22 ], [ 132, 31 ], [ 143, 34 ], [ 38, 37 ], [ 138, 43 ], [ 138, 48 ], [ 37, 49 ], [ 138, 51 ], [ 37, 53 ...
[ "import sys\nreadline = sys.stdin.readline\n\nN,L = map(int,readline().split())\nA = list(map(int,readline().split()))\n\n# 2個でL以上の隣合うペアがどこかにあれば、そこを最後に残せば大丈夫\ntarget = -1\nfor i in range(1,len(A)):\n if A[i] + A[i - 1] >= L:\n target = i\n break\nif target == -1:\n print(\"Impossible\")\n exit(0)\n\nleft =...
import sys readline = sys.stdin.readline N,L = map(int,readline().split()) A = list(map(int,readline().split())) # 2個でL以上の隣合うペアがどこかにあれば、そこを最後に残せば大丈夫 target = -1 for i in range(1,len(A)): if A[i] + A[i - 1] >= L: target = i break if target == -1: print("Impossible") exit(0) left = [] for i in range(1,ta...
[ 7, 15, 13, 15, 13, 15, 13, 15, 13, 4, 18, 13, 13, 17, 12, 13, 29, 4, 13, 4, 13, 12, 13, 29, 4, 13, 13, 4, 18, 4, 13, 13, 17, 12, 13, 29, 4, 13, 12, 13, 29, 4, 18, 4, 13, 13, 17, 12, 13, 29, 4, 13, 4, 13, 12, ...
[ [ 63, 61 ], [ 63, 63 ], [ 68, 67 ], [ 67, 74 ], [ 79, 76 ], [ 67, 77 ], [ 91, 80 ], [ 76, 84 ], [ 67, 85 ], [ 70, 89 ], [ 91, 91 ], [ 200, 93 ], [ 236, 107 ], [...
[ "import bisect\nimport sys\nimport math\nimport itertools\nsys.setrecursionlimit(10000)\n \n# input macro\ndef i():\n return int(raw_input())\ndef ii():\n return map(int,raw_input().split(\" \"))\ndef s():\n return raw_input()\ndef ss():\n return raw_input().split(\" \")\ndef slist():\n return list(r...
import bisect import sys import math import itertools sys.setrecursionlimit(10000) # input macro def i(): return int(raw_input()) def ii(): return map(int,raw_input().split(" ")) def s(): return raw_input() def ss(): return raw_input().split(" ") def slist(): return list(raw_input()) # def join(...
[ 7, 15, 13, 15, 13, 15, 13, 15, 13, 15, 13, 15, 15, 15, 15, 15, 4, 18, 13, 13, 17, 12, 13, 29, 4, 13, 4, 13, 12, 13, 29, 4, 13, 4, 13, 13, 4, 18, 4, 13, 13, 12, 13, 29, 4, 13, 4, 13, 12, 13, 29, 4, 13, 4, 13, ...
[ [ 90, 89 ], [ 102, 101 ], [ 108, 107 ], [ 133, 109 ], [ 116, 115 ], [ 240, 121 ], [ 115, 123 ], [ 101, 124 ], [ 107, 127 ], [ 99, 131 ], [ 133, 133 ], [ 252, 135 ], [ 1...
[ "# -*- coding: utf-8 -*-\nimport bisect\nimport heapq\nimport math\nimport random\nimport sys\nfrom collections import Counter, defaultdict, deque\nfrom decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal\nfrom functools import lru_cache, reduce\nfrom itertools import combinations, combinations_with_replacement, p...
# -*- coding: utf-8 -*- import bisect import heapq import math import random import sys from collections import Counter, defaultdict, deque from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal from functools import lru_cache, reduce from itertools import combinations, combinations_with_replacement, product, permut...
[ 7, 15, 13, 0, 13, 4, 13, 17, 0, 13, 2, 2, 17, 17, 17, 41, 28, 13, 4, 18, 4, 18, 18, 13, 13, 13, 13, 4, 4, 13, 13, 12, 13, 41, 28, 13, 4, 18, 4, 18, 18, 13, 13, 13, 13, 4, 2, 4, 13, 13, 17, 12, 13, 41, 28, 1...
[ [ 156, 4 ], [ 150, 9 ], [ 18, 17 ], [ 17, 30 ], [ 36, 35 ], [ 35, 49 ], [ 56, 55 ], [ 55, 68 ], [ 81, 80 ], [ 172, 82 ], [ 81, 83 ], [ 86, 85 ], [ 172, 87 ], [ ...
[ "# coding:utf-8\n\nimport sys\n\nINF = float('inf')\nMOD = 10 ** 9 + 7\n\ndef LI(): return [int(x) for x in sys.stdin.readline().split()]\ndef LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]\ndef LF(): return [float(x) for x in sys.stdin.readline().split()]\ndef LS(): return sys.stdin.readline().sp...
# coding:utf-8 import sys INF = float('inf') MOD = 10 ** 9 + 7 def LI(): return [int(x) for x in sys.stdin.readline().split()] def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()] def LF(): return [float(x) for x in sys.stdin.readline().split()] def LS(): return sys.stdin.readline().split() def II():...
[ 7, 15, 13, 0, 13, 18, 18, 13, 13, 13, 0, 13, 4, 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, 28, 13, 4, 13, 17, 13, 14, 40, 2, 18, 13, 13, 18, 13, 2, 13, 17, 13...
[ [ 92, 4 ], [ 101, 11 ], [ 98, 16 ], [ 93, 23 ], [ 98, 25 ], [ 89, 27 ], [ 93, 36 ], [ 40, 39 ], [ 96, 43 ], [ 90, 48 ], [ 39, 49 ], [ 90, 51 ], [ 39, 53 ], [ ...
[ "import sys\ninput = sys.stdin.readline\ninf = float(\"inf\")\n\nn,L = map(int,input().split())\na = tuple(map(int,input().split()))\n\nfor i in range(1,n):\n if a[i]+a[i-1]>=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)...
import sys input = sys.stdin.readline inf = float("inf") n,L = map(int,input().split()) a = tuple(map(int,input().split())) for i in range(1,n): if a[i]+a[i-1]>=L: print('Possible') for j in range(1,i): print(j) for j in range(n-1,i,-1): print(j) print(i) ...
[ 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, 2, 13, 17, 14, 2, 2, 18, 13, 13, 18, 13, 2, 13, 17, 13, 0, 13, 2, 18, ...
[ [ 125, 2 ], [ 125, 11 ], [ 15, 14 ], [ 14, 23 ], [ 113, 25 ], [ 107, 28 ], [ 116, 31 ], [ 35, 34 ], [ 126, 38 ], [ 114, 44 ], [ 34, 45 ], [ 114, 47 ], [ 34, 49 ],...
[ "N,L=map(int,input().split())\na=[int(i) for i in input().split()]\nLongest_pair=0\np=0\nfor i in range(N-1):\n if a[i]+a[i+1]>Longest_pair:\n Longest_pair=a[i]+a[i+1]\n p=i+1\nif Longest_pair<L:\n print(\"Impossible\")\n exit()\nelse:\n print(\"Possible\")\nfor i in range(1,p):\n print(i)\nfor i in rang...
N,L=map(int,input().split()) a=[int(i) for i in input().split()] Longest_pair=0 p=0 for i in range(N-1): if a[i]+a[i+1]>Longest_pair: Longest_pair=a[i]+a[i+1] p=i+1 if Longest_pair<L: print("Impossible") exit() else: print("Possible") for i in range(1,p): print(i) for i in range(p+1,N)[::-1]: print(...
[ 7, 15, 13, 0, 13, 18, 13, 13, 4, 18, 13, 13, 2, 17, 17, 12, 13, 12, 13, 12, 13, 12, 13, 12, 13, 12, 13, 12, 13, 12, 13, 0, 13, 4, 13, 13, 0, 13, 4, 13, 4, 13, 0, 13, 17, 28, 13, 39, 13, 13, 4, 13, 4, 13, 18, ...
[ [ 133, 4 ], [ 169, 32 ], [ 173, 34 ], [ 169, 35 ], [ 151, 37 ], [ 173, 41 ], [ 148, 43 ], [ 152, 55 ], [ 152, 59 ], [ 161, 67 ], [ 71, 70 ], [ 70, 76 ], [ 130, 79 ...
[ "import sys\nstdin = sys.stdin\n \nsys.setrecursionlimit(10**5) \n \ndef li(): return map(int, stdin.readline().split())\ndef li_(): return map(lambda x: int(x)-1, stdin.readline().split())\ndef lf(): return map(float, stdin.readline().split())\ndef ls(): return stdin.readline().split()\ndef ns(): return stdin.read...
import sys stdin = sys.stdin sys.setrecursionlimit(10**5) def li(): return map(int, stdin.readline().split()) def li_(): return map(lambda x: int(x)-1, stdin.readline().split()) def lf(): return map(float, stdin.readline().split()) def ls(): return stdin.readline().split() def ns(): return stdin.readline().rstrip(...
[ 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, 2, 39, 17, 2, 13, 17, 28, 13, 13, 4, 13, 13, 0, 13, 39, 0, 13, 17, 0, 13, 2, 13, 17, 42, 2, 13, 13, 14, 2, 2, 18, ...
[ [ 134, 2 ], [ 134, 11 ], [ 15, 13 ], [ 125, 24 ], [ 135, 29 ], [ 128, 38 ], [ 119, 41 ], [ 116, 44 ], [ 135, 46 ], [ 120, 50 ], [ 114, 50 ], [ 117, 51 ], [ 132, 51 ...
[ "N,L = map(int,input().split())\n*A, = map(int,input().split())\n\nS = [0]*(N+1)\nfor i,a in enumerate(A): S[i+1] = S[i] + a\nans = []\ni=0\nj=N-1\nwhile i<j:\n if S[j+1]-S[i] < L:\n print(\"Impossible\")\n break\n if A[i]+A[i+1] <= A[j]+A[j-1]:\n ans.append(i+1)\n i+=1\n else:\...
N,L = map(int,input().split()) *A, = map(int,input().split()) S = [0]*(N+1) for i,a in enumerate(A): S[i+1] = S[i] + a ans = [] i=0 j=N-1 while i<j: if S[j+1]-S[i] < L: print("Impossible") break if A[i]+A[i+1] <= A[j]+A[j-1]: ans.append(i+1) i+=1 else: ans.append(j) ...
[ 7, 15, 13, 13, 13, 0, 13, 2, 2, 17, 17, 17, 0, 13, 39, 39, 17, 17, 39, 17, 17, 39, 17, 17, 39, 17, 17, 12, 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, 13, 13...
[ [ 187, 6 ], [ 202, 13 ], [ 32, 31 ], [ 31, 44 ], [ 52, 51 ], [ 200, 57 ], [ 61, 61 ], [ 80, 67 ], [ 71, 67 ], [ 82, 68 ], [ 73, 68 ], [ 72, 71 ], [ 82, 72 ], [ ...
[ "import sys,bisect,heapq\n\nmod = 10**9+7\ndd = ((-1, 0), (0, -1), (1, 0), (0, 1))\n\ndef I(): return(int(sys.stdin.readline()))\ndef LI(): return([int(x) for x in sys.stdin.readline().split()])\ndef S(): return(input())\ndef IR(n): return([I() for _ in range(n)])\n\ndef GCD(a,b):\n while(a%b != 0):\n a,b...
import sys,bisect,heapq mod = 10**9+7 dd = ((-1, 0), (0, -1), (1, 0), (0, 1)) def I(): return(int(sys.stdin.readline())) def LI(): return([int(x) for x in sys.stdin.readline().split()]) def S(): return(input()) def IR(n): return([I() for _ in range(n)]) def GCD(a,b): while(a%b != 0): a,b = b,a%b retu...
[ 7, 0, 13, 4, 18, 4, 13, 13, 13, 0, 13, 4, 13, 13, 13, 4, 13, 13, 0, 13, 2, 39, 17, 13, 0, 13, 4, 18, 4, 13, 13, 28, 13, 4, 13, 13, 0, 18, 13, 13, 4, 13, 18, 13, 13, 12, 13, 28, 13, 4, 13, 2, 13, 17, 14, 40,...
[ [ 139, 2 ], [ 139, 8 ], [ 121, 10 ], [ 140, 13 ], [ 130, 14 ], [ 125, 17 ], [ 127, 19 ], [ 122, 23 ], [ 140, 23 ], [ 136, 25 ], [ 33, 32 ], [ 122, 35 ], [ 140, 35 ...
[ "N, L = input().split()\nN, L = int(N), int(L)\n\na = [0]*N\n\ninputStr = input().split()\nfor i in range(N):\n a[i] = int(inputStr[i])\n\ndef check():\n for i in range(N-1):\n if(a[i]+a[i+1]>=L):\n return i\n return -1\n\nb = check()\n\nif(b==-1):\n print(\"Impossible\")\nelse:\n p...
N, L = input().split() N, L = int(N), int(L) a = [0]*N inputStr = input().split() for i in range(N): a[i] = int(inputStr[i]) def check(): for i in range(N-1): if(a[i]+a[i+1]>=L): return i return -1 b = check() if(b==-1): print("Impossible") else: print("Possible") for 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, 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 ], [ 89, 13 ], [ 98, 25 ], [ 29, 28 ], [ 93, 32 ], [ 90, 38 ], [ 28, 39 ], [ 90, 41 ], [ 28, 43 ], [ 87, 45 ], [ 95, 47 ], [ 28, 49 ], [ ...
[ "n,l = map(int, input().split())\na = list(map(int, input().split()))\n\nx = -1\n\nfor i in range(n-1):\n if a[i]+a[i+1] >= l:\n x = i+1\n break\n\nif x == -1:\n print('Impossible')\nelse:\n print('Possible')\n for i in range(1,x):\n print(i)\n for i in range(n-x):\n print...
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+1 break if x == -1: print('Impossible') else: print('Possible') for i in range(1,x): print(i) for i in range(n-x): print(n-i-1)
[ 7, 15, 13, 15, 13, 15, 15, 15, 0, 13, 18, 18, 13, 13, 13, 4, 18, 13, 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,...
[ [ 122, 9 ], [ 119, 23 ], [ 33, 32 ], [ 123, 39 ], [ 33, 41 ], [ 44, 43 ], [ 123, 52 ], [ 56, 55 ], [ 59, 58 ], [ 32, 62 ], [ 43, 68 ], [ 58, 69 ], [ 43, 71 ], [...
[ "import sys\nimport heapq\nfrom operator import itemgetter\nfrom collections import deque, defaultdict\nfrom bisect import bisect_left, bisect_right\ninput = sys.stdin.readline\nsys.setrecursionlimit(10 ** 7)\nMOD = 10**9 + 7\n\ndef sol():\n N, L = map(int, input().split())\n A = list(map(int, input().split()...
import sys import heapq from operator import itemgetter from collections import deque, defaultdict from bisect import bisect_left, bisect_right input = sys.stdin.readline sys.setrecursionlimit(10 ** 7) MOD = 10**9 + 7 def sol(): N, L = map(int, input().split()) A = list(map(int, input().split())) left = 0...
[ 7, 15, 13, 15, 13, 15, 13, 15, 13, 15, 13, 15, 13, 15, 15, 15, 12, 13, 12, 13, 12, 13, 0, 13, 4, 13, 13, 0, 13, 4, 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,...
[ [ 113, 23 ], [ 108, 25 ], [ 113, 26 ], [ 122, 28 ], [ 102, 30 ], [ 116, 32 ], [ 36, 35 ], [ 111, 39 ], [ 123, 45 ], [ 35, 46 ], [ 123, 48 ], [ 35, 50 ], [ 114, 52 ...
[ "import sys\nimport heapq\nimport math\nimport fractions\nimport bisect\nimport itertools\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\ndef input(): return sys.stdin.readline().strip()\ndef mp(): return map(int,input().split())\ndef lmp(): return list(map(int,inpu...
import sys import heapq import math import fractions import bisect import itertools from collections import Counter from collections import deque from operator import itemgetter def input(): return sys.stdin.readline().strip() def mp(): return map(int,input().split()) def lmp(): return list(map(int,input().split())) n...
[ 7, 0, 13, 4, 13, 13, 4, 18, 4, 18, 4, 13, 17, 13, 13, 13, 31, 13, 0, 13, 39, 28, 13, 4, 13, 17, 13, 14, 2, 2, 18, 13, 13, 18, 13, 2, 13, 17, 13, 4, 18, 13, 13, 13, 28, 13, 4, 13, 2, 13, 17, 2, 13, 17, 17, 4...
[ [ 82, 2 ], [ 82, 15 ], [ 82, 16 ], [ 79, 19 ], [ 23, 22 ], [ 83, 26 ], [ 22, 32 ], [ 22, 36 ], [ 77, 38 ], [ 80, 41 ], [ 22, 43 ], [ 46, 45 ], [ 83, 49 ], [ ...
[ "n,l,*a=map(int,open(0).read().split())\nans=[] \nfor i in range(1,n):\n if a[i]+a[i-1]<l:\n ans.append(i)\n else:\n for j in range(n-1,i-1,-1):\n ans.append(j)\n print(\"Possible\")\n print(*ans,sep=\"\\n\")\n exit()\nprint(\"Impossible\") ", "n,l,*a=ma...
n,l,*a=map(int,open(0).read().split()) ans=[] for i in range(1,n): if a[i]+a[i-1]<l: ans.append(i) else: for j in range(n-1,i-1,-1): ans.append(j) print("Possible") print(*ans,sep="\n") exit() print("Impossible")
[ 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, 0, 13, 39, 28, 13, 4, 13, 17...
[ [ 100, 2 ], [ 100, 11 ], [ 15, 14 ], [ 14, 23 ], [ 103, 25 ], [ 29, 28 ], [ 101, 32 ], [ 104, 37 ], [ 28, 39 ], [ 104, 42 ], [ 28, 43 ], [ 95, 44 ], [ 97, 49 ], ...
[ "N, L = map(int, input().split())\nA = [int(i) for i in input().split()]\n\nfor i in range(1, N):\n if A[i-1]+A[i] >= L:\n print('Possible')\n ans = []\n for j in range(1, i):\n ans.append(j)\n for k in range(N-1, i, -1):\n ans.append(k)\n ans.append(i)\n ...
N, L = map(int, input().split()) A = [int(i) for i in input().split()] for i in range(1, N): if A[i-1]+A[i] >= L: print('Possible') ans = [] for j in range(1, i): ans.append(j) for k in range(N-1, i, -1): ans.append(k) ans.append(i) print(*ans...
[ 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, 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,...
[ [ 94, 4 ], [ 94, 13 ], [ 17, 16 ], [ 16, 25 ], [ 100, 27 ], [ 97, 30 ], [ 34, 33 ], [ 95, 37 ], [ 101, 43 ], [ 33, 44 ], [ 101, 46 ], [ 33, 48 ], [ 92, 50 ], [ ...
[ "import sys\nn, l = map(int, input().split())\na = [int(x) for x in input().split()]\n\nkey = -1\nfor i in range(n-1):\n if a[i]+a[i+1] >= l:\n key = i\n break\n\nif key == -1:\n print(\"Impossible\")\nelse:\n print(\"Possible\")\n for i in range(key):\n print(i+1)\n for i in range(n-1, key, -1):\n ...
import sys n, l = map(int, input().split()) a = [int(x) for x in input().split()] key = -1 for i in range(n-1): if a[i]+a[i+1] >= l: key = i break if key == -1: print("Impossible") else: print("Possible") for i in range(key): print(i+1) for i in range(n-1, key, -1): print(i)
[ 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, 0, 13, 39, 28, 13, 4, 13, 17, 2, 4, 13, 13, 17, 14, 40, 2, 18, 13, 13, 18, 13, 2, 13, 17, 13, 0, 13, ...
[ [ 124, 4 ], [ 124, 13 ], [ 121, 15 ], [ 118, 27 ], [ 127, 30 ], [ 34, 33 ], [ 125, 40 ], [ 122, 46 ], [ 33, 47 ], [ 122, 49 ], [ 33, 51 ], [ 113, 53 ], [ 115, 55 ...
[ "import numpy as np\n\nn, l = map(int, input().split())\nknot = list(map(int, input().split()))\n\nflg = 0\nli = []\nfor i in range(0, int(n) - 1):\n if(knot[i] + knot[i + 1] >= l):\n flg = 1\n print(\"Possible\")\n li.append(i + 1)\n\n for j in range(i + 2, n):\n li.append...
import numpy as np n, l = map(int, input().split()) knot = list(map(int, input().split())) flg = 0 li = [] for i in range(0, int(n) - 1): if(knot[i] + knot[i + 1] >= l): flg = 1 print("Possible") li.append(i + 1) for j in range(i + 2, n): li.append(j) for j in ...
[ 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, 39, 17, 2, 13, 17, 28, 13, 4, 13, 2, 13, 17, 0, 18, 13, 13, 2, 18, 13, 13, 18, 13, 2, 13, 17, 14, 2, 4, 13, ...
[ [ 109, 2 ], [ 109, 11 ], [ 103, 13 ], [ 100, 25 ], [ 98, 30 ], [ 34, 33 ], [ 98, 37 ], [ 43, 40 ], [ 101, 41 ], [ 33, 42 ], [ 104, 45 ], [ 33, 46 ], [ 104, 48 ], ...
[ "n,l=map(int,input().split())\na=list(map(int,input().split()))\nmu=[0]*(n-1)\nfor i in range(n-1):\n mu[i]=a[i]+a[i+1]\nif max(mu)<l:\n print(\"Impossible\")\nelse:\n print(\"Possible\")\n s=mu.index(max(mu))\n for i in range(1,s+1):\n print(i)\n for i in range(n-1,s,-1):\n print(i)...
n,l=map(int,input().split()) a=list(map(int,input().split())) mu=[0]*(n-1) for i in range(n-1): mu[i]=a[i]+a[i+1] if max(mu)<l: print("Impossible") else: print("Possible") s=mu.index(max(mu)) for i in range(1,s+1): print(i) for i in range(n-1,s,-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, 0, 13, 2, 39, 17, 2, 13, 17, 28, 13, 4, 13, 2, 13, 17, 0, 18, 13, 13, 2, 18, 13, 13, 18, 13, 2, 13, 17, 14, 2, 4, 13, ...
[ [ 115, 2 ], [ 115, 11 ], [ 112, 13 ], [ 109, 25 ], [ 116, 30 ], [ 34, 33 ], [ 116, 37 ], [ 43, 40 ], [ 110, 41 ], [ 33, 42 ], [ 113, 45 ], [ 33, 46 ], [ 113, 48 ]...
[ "N, L = map(int, input().split())\na = list(map(int, input().split()))\n\nsum = [0]*(N - 1)\nfor i in range(N-1):\n sum[i] = a[i] + a[i+1]\n\nif max(sum) < L:\n print(\"Impossible\")\nelse:\n print(\"Possible\")\n id = sum.index(max(sum))\n for i in range(id):\n print(i+1)\n for i in revers...
N, L = map(int, input().split()) a = list(map(int, input().split())) sum = [0]*(N - 1) for i in range(N-1): sum[i] = a[i] + a[i+1] if max(sum) < L: print("Impossible") else: print("Possible") id = sum.index(max(sum)) for i in range(id): print(i+1) for i in reversed(range(id+1, N-1)): ...
[ 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, 41, 28, 13, 13, 4, 13, 18, 13, 39, 17, 4, 2, 13, 18, 13, 2, 13, 17, 0, 13, 13, 4, 18, 13,...
[ [ 4, 3 ], [ 3, 12 ], [ 123, 14 ], [ 123, 16 ], [ 20, 19 ], [ 19, 28 ], [ 111, 30 ], [ 112, 39 ], [ 112, 46 ], [ 114, 51 ], [ 115, 55 ], [ 115, 59 ], [ 115, 64 ], ...
[ "N,L = [int(x) for x in input().split()]\nA = [int(x) for x in input().split()]\n\nA2 = [x+A[ind+1] for ind,x in enumerate(A[:-1])]\nA2.index(max(A2))\nif(max(A2)<L):\n print('Impossible')\nelse:\n print('Possible')\n last = A2.index(max(A2))\n for i in range(last):\n print(i+1)\n for i in ran...
N,L = [int(x) for x in input().split()] A = [int(x) for x in input().split()] A2 = [x+A[ind+1] for ind,x in enumerate(A[:-1])] A2.index(max(A2)) if(max(A2)<L): print('Impossible') else: print('Possible') last = A2.index(max(A2)) for i in range(last): print(i+1) for i in range(N-1,last+1,-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, ...
[ [ 105, 2 ], [ 105, 11 ], [ 96, 13 ], [ 102, 25 ], [ 29, 28 ], [ 106, 32 ], [ 97, 38 ], [ 28, 39 ], [ 97, 41 ], [ 28, 43 ], [ 94, 45 ], [ 99, 47 ], [ 28, 48 ], [...
[ "N, L = map(int, input().split())\n\nA = list(map(int, input().split()))\n\nans_index = -1\nfor i in range(N-1):\n if A[i] + A[i+1] >= L:\n ans_index = i\n break\n\nif ans_index == -1:\n print('Impossible')\n exit()\nprint('Possible')\n\nans_index += 1\nfor i in range(1, ans_index):\n prin...
N, L = map(int, input().split()) A = list(map(int, input().split())) ans_index = -1 for i in range(N-1): if A[i] + A[i+1] >= L: ans_index = i break if ans_index == -1: print('Impossible') exit() print('Possible') ans_index += 1 for i in range(1, ans_index): print(i) for i in range(N-...