Иван Загребин, ФКИ м106 ShuffleString 2322 | Савидов Георгий Анатольевич, 527 группа ShuffleString 1838 | ||||
---|---|---|---|---|---|
t | 1 | s1, s2 = (input(), input()) | t | 1 | first, second = (input(), input()) |
2 | for n in range(len(s1)): | 2 | for i in range(len(first)): | ||
3 | if s2 == ''.join([s1[start::n] for start in range(n)]): | 3 | if second == ''.join([first[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 | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|