#include #include #include #include #include using namespace std;int main(void){ ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n, m; cin >> n >> m; vector> a(n + 1, vector(n + 1, 0)); vector> d(n + 1, vector(n + 1, 0)); for (int i = 1; i > a[i][j]; d[i][j] = d[i][j - 1] + d[i - 1][j] - d[i - 1][j - 1] + a[i][j]; } } for (int i = 0..