Taigar2000

D

Oct 17th, 2020 (edited)
471
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. input()
  2. a = input().split()
  3. if(a == a[::-1]):
  4.     print(0)
  5. else:
  6.     n = 0
  7.     for i in range(1, len(a)):
  8.         if(a[i:] == a[:i-1:-1]):
  9.             n = i
  10.             break
  11.     print(n)
  12.     print(*a[n-1::-1], sep=' ')
  13.  
RAW Paste Data