Write a command-line program at /app/pathfind that reads a grid and one or more agent queries from stdin and…
Write a command-line program at /app/pathfind that reads a grid and one or more agent queries from stdin and…: a task in TermGrade Environments: 1,004 executable Linux tasks (Harbor dataset). Input format (stdin): - Line 1: two integers rows cols (1 ≤ rows, cols ≤ 500) - Next rows lines: each…
The task
**Input format (stdin):** - Line 1: two integers `rows cols` (1 ≤ rows, cols ≤ 500) - Next `rows` lines: each contains `cols` integers separated by single spaces. Each integer is the terrain cost (0–9). A cost of 0 means impassable (cannot be entered). - Next line: one integer `Q` (1 ≤ Q ≤ 100) — number of queries. -…
Part of ai-and/termgrade-environments.