#include using namespace std; using ll = long long; using ld = long double; using pii = pair; using vi = vector; using vvi = vector; #define rep(i, a, b) for(ll i = (a); i < (b); i++) #define repb(i, a, b) for(ll i = (b) - 1; i >= (a); i--) #define all(x) begin(x),end(x) #define sz(x) (int)(x).size() ll read_double() { ll x, y; char c; cin >> x >> c >> y; if (y) while (y < 100) y *= 10; return x * 1000 + y; } void solve() { ll n; cin >> n; ll nn = n * 1000; ll r = read_double(); vector allowed(n+1, vector(n + 1, true)); vector out; rep(i,0,n+1) rep(j,0,n+1) { if (!allowed[i][j]) continue; ll x = i * 1000, y = j * 1000; if (x < r || y < r || nn - x < r || nn - y < r) continue; out.emplace_back(i, j); rep(k,0,n+1) rep(k2,0,n+1) { ll kx = 1000 * k, ky = k2 * 1000; if ((kx-x)*(kx-x)+(ky-y)*(ky-y) < (4 * r * r)) allowed[k][k2] = false; } } cout << ssize(out) << "\n"; for (auto [x, y] : out) cout << x << ' ' << y << '\n'; } int main() { cin.tie(0)->sync_with_stdio(0); cin.exceptions(cin.failbit); //ll t; cin >> t; while(t--) solve(); }