#include using namespace std; const long long INF = 1LL << 60; // 10^18 より大きい const int inf = 1<<30; // 10^9 より大きい const long long MOD1 = 1000000007; const long long MOD2 = 998244353; typedef long long ll; //a:97, A:65 const int dx[]={1,0,-1,0,-1,1,1,-1}; const int dy[]={0,1,0,-1,-1,-1,1,1}; const double PI = acos(-1); #define Yes cout << "Yes\n" #define No cout << "No\n" typedef pair pll; typedef pair pii; typedef vector> vvi; typedef vector> vvll; // priority_queue,greater> q; template inline bool chmin(T& a, const U& b) { if (a > b) { a = b; return true; } return false; } template inline bool chmax(T& a, const U& b) { if (a < b) { a = b; return true; } return false; } /* 好きなマスからスタート 同じマスを訪れない。 */ int N=20,T=400; int A[400][400]; vector> ans; void solve(){ int y=0,x=0; // 初期位置 int score=A[y][x]; vvi used(N,vector(N,0)); ans.push_back({0,0}); used[0][0]=1; for(int t=0;t> dummy >> T; for(int i=0;i> A[i][j]; solve(); cout << ans.size() << "\n"; for(auto v:ans) cout << v.first << " " << v.second << "\n"; }