Lang:G++
Edit12345678910111213141516171819202122232425262728293031#include <iostream>#include <string>#include <vector>using namespace std;int n, m, x, y;inline int calculate(int a, int b) {int tmp1, tmp2;if (a > 0) tmp1 = (n-x)/a;else tmp1 = x/-a;if (b > 0) tmp2 = (m-y)/b;else tmp2 = y/-b;return min(tmp1, tmp2);}inline int zhengchu(int a, int b) {if (b < 0) b = -b;return a/b;}int main(int argc, const char *argv[]) {int a, b, c, d;cin >> n >> m >> x >>y;cin >> a >> b >> c >> d;int res = 1;if (a*b*c*d == 0) {// 4 zerosif (a==0 && b==0 && c==0 && d==0) {}// 3 zeroselse if (a==0 && b==0 && c==0) res += abs((m-x)/d);