[ create a new paste ] login | about

Link: http://codepad.org/mla6qDlN    [ raw code | output | fork ]

Python, pasted on Dec 8:
1
2
3
4
5
6
7
8
9
10
s=1
while s:
 s=map(int,raw_input().split());k=len(s);n=2*k;x=k/1.34
 while n:
  x/=1.68;g=int(x)
  for i in range(0,k-g):
   if not n:break
   n-=1
   if s[i]>s[i+g]:s[i],s[i+g]=s[i+g],s[i]
 print' '.join(map(str,s))


Output:
1
2
3
4
Traceback (most recent call last):
  Line 3, in <module>
    s=map(int,raw_input().split());k=len(s);n=2*k;x=k/1.34
EOFError


Create a new paste based on this one


Comments: