#yuki20 import heapq,sys direction=[(1,0),(0,1),(-1,0),(0,-1)] def dijkstra(sx,sy,L): N=len(L) dist=[[float("inf")] * N for i in xrange(N)] dist[sy][sx]= 0 queue=[(0,sx,sy)] while queue: d,x,y = heapq.heappop(queue) if dist[y][x]d+L[ny][nx]: dist[ny][nx]=d+L[ny][nx] heapq.heappush(queue,(dist[ny][nx], nx, ny)) return dist n,v,xx,yy=map(int,raw_input().split()) l=[map(int,raw_input().split()) for i in xrange(n)] xx-=1 yy-=1 dist=dijkstra(0,0,l) if dist[n-1][n-1]=0 and dist[yy][xx]