题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5301
#include <iostream> #include <stdio.h> #include <string.h> #include <algorithm> using namespace std; int n,m,x,y,s,l; int main() { while(~scanf("%d%d%d%d",&n,&m,&x,&y)){ if(m > n){ s = max(n-x,x-); s = min(s,min(m-y+,y)); } else{ s = max(m-y,y-); s = min(s,min(n-x+,x)); } l = min((m+)/,(n+)/); s = max(s,l); == && x == y && x == (n+)/) s -= ; printf("%d\n",s); } ; }