https://www.acmicpc.net/problem/18352from collections import dequeimport sysinput = sys.stdin.readlinen, m, k, x = map(int, input().split())graph = [[] for _ in range(n+1)]distance = [0] * (n+1)visited = [False] * (n+1)answer = []for _ in range(m): a, b = map(int, input().split()) graph[a].append(b)def bfs(v): que = deque() que.append(v) visited[v] = True while que: now ..