-Code
n, m = map(int, input().split())
s_list = list(input().split())
t_list = list(input().split())
for _ in range(int(input())):
year = int(input())
res = s_list[year % n - 1] + t_list[year % m - 1]
print(res)
'Beakjoon&프로그래머스 > 파이썬' 카테고리의 다른 글
[백준/파이썬] 6765번 Icon Scaling (0) | 2024.01.14 |
---|---|
[백준/파이썬] 14322번 Country Leader (Small) (0) | 2024.01.13 |
[백준/파이썬] 9783번 Easy Encryption (0) | 2024.01.11 |
[백준/파이썬] 12184번 GBus count (Small) (1) | 2024.01.10 |
[백준/파이썬] 26751번 Najmniejsza liczba (1) | 2024.01.09 |