fork(3) download
  1. from sys import exit
  2.  
  3. __author__ = 'Zlobober'
  4. s = raw_input()
  5. k = int(raw_input())
  6. n = len(s)
  7. if len(s) % k != 0:
  8. print "NO"
  9. else:
  10. for i in range(k):
  11. if s[i * (n // k) : (i + 1) * (n // k)] != ''.join(reversed(s[i * (n // k) : (i + 1) * (n // k)])):
  12. print "NO"
  13. exit(0)
  14. print "YES"
  15.  
Runtime error #stdin #stdout #stderr 0.01s 7692KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "prog.py", line 4, in <module>
EOFError: EOF when reading a line