10158
[실3] 10158 - 개미
#include #pragma region 입출력 속도향상 #define FAST_IO() \ {\ ios::sync_with_stdio(false);\ cin.tie(NULL); \ cout.tie(NULL); \ }\ #pragma endregion using namespace std; #define x first #define y second int main() { FAST_IO(); int w, h, p, q, t; cin >> w >> h >> p >> q >> t; p += t; q += t; p %= (2 * w); q %= (2 * h); if (p > w) p = 2 * w - p; if (q > h) q = 2 * h - q; cout