Михальцов Данила, 528 ShuffleString 3354 | Почернина Ольга, 528 группа ShuffleString 2780 | ||||
---|---|---|---|---|---|
t | 1 | a = input() | t | 1 | s1 = input() |
2 | b = input() | 2 | s2 = input() | ||
3 | for n in range(1, len(a)): | 3 | for n in range(1, len(s1)): | ||
4 | ans = ''.join((a[start::n] for start in range(n))) | 4 | s = ''.join([s1[start::n] for start in range(n)]) | ||
5 | if b == ans: | 5 | if s == s2: | ||
6 | print(n) | 6 | print(n) | ||
7 | break | 7 | break | ||
8 | else: | 8 | else: | ||
9 | print('No') | 9 | print('No') |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|