Александр Цехмистер, 527 группа ShuffleString 2276 | Евгений Демидович, 521 группа ShuffleString 2018 | ||||
---|---|---|---|---|---|
t | 1 | s1, s2 = (input(), input()) | t | 1 | orig, conv = (input(), input()) |
2 | for n in range(1, len(s1)): | 2 | for i in range(1, len(orig)): | ||
3 | if s2 == ''.join([s1[i::n] for i in range(n)]): | 3 | if conv == ''.join((orig[j::i] for j in range(i))): | ||
4 | print(n) | 4 | print(i) | ||
5 | break | 5 | break | ||
6 | else: | 6 | else: | ||
7 | print('No') | 7 | print('No') |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|