#include<bits/stdc++.h> using namespace std; int main() { int h,w; cin>>h>>w; int r,c; cin>>r>>c; int res=0; if(r-1>=1) res++; if(r+1<=h) res++; if(c-1>=1) res++; if(c+1<=w) res++; cout<<res; return 0; }
Using your lizikid universal account