#include int min(int a, int b) { if(a0); if(hall) printf("%d\n", min(r*2+hall+1, r+hall*2+2)); else printf("%d\n", r+2); } return 0; }