CF2038K Grid Walk
题目描述
### 题意翻译
给定一个 $n\times n$ 的矩阵和两个正整数 $a$ 和 $b$,第 $i$ 行第 $j$ 列的权值 $c_{i,j}=\gcd(i,a)+\gcd(j,b)$,一开始你在点 $(1,1)$,你可以向右或者向下走,一直走到点 $(n,n)$。
你需要规划一条路径,使得从点 $(1,1)$ 走到点 $(n,n)$ 所经过的点的权值和 $\sum c_{i,j}$ 最小,输出这个最小值。
输入格式
无
输出格式
无
说明/提示
The first example is described in the picture above.