#yuki20 import heapq,sys direction=[(1,0),(0,1),(-1,0),(0,-1)] def dijkstra(sx,sy,l): dist=[[float('inf')]*len(l) for i in xrange(len(l))] dist[sx][sy]=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]