Write a command-line tool /app/pathfinder in Python that reads a grid from stdin, computes the shortest path…
Write a command-line tool /app/pathfinder in Python that reads a grid from stdin, computes the shortest path…: a task in termgrade-bandcentral-gemma4-31b-bash: TermGrade Band-Central: the 151-task selection and its splits (Harbor dataset). Input format : - First line: two integers H W (height and…
The task
**Input format**: - First line: two integers `H W` (height and width, 1 ≤ H,W ≤ 1000) - Next H lines: W integers each, space-separated, representing movement cost (non-negative integers, 0 ≤ cost ≤ 10^6) - Start at (0,0) with initial cost = grid[0][0] - End at (H-1, W-1)