From 0dc2cb7fe2d4311330a29e8559d43c07a6ffdeab Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Thu, 22 Dec 2022 21:49:09 +0800 Subject: [PATCH] =?UTF-8?q?2299.=20[HAOI2011]=E5=90=91=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://hydro.ac/d/bzoj/record/63a46049cf75a716a1673aee --- BZOJ/2299/2299.cpp | 30 ++++++++++++++++++++++++++++++ BZOJ/2299/data/1.in | 3 +++ BZOJ/2299/data/1.out | 3 +++ BZOJ/2299/data/10.in | 3 +++ BZOJ/2299/data/10.out | 3 +++ BZOJ/2299/data/11.in | 3 +++ BZOJ/2299/data/11.out | 3 +++ BZOJ/2299/data/2.in | 3 +++ BZOJ/2299/data/2.out | 3 +++ BZOJ/2299/data/3.in | 3 +++ BZOJ/2299/data/3.out | 3 +++ BZOJ/2299/data/4.in | 3 +++ BZOJ/2299/data/4.out | 3 +++ BZOJ/2299/data/5.in | 3 +++ BZOJ/2299/data/5.out | 3 +++ BZOJ/2299/data/6.in | 3 +++ BZOJ/2299/data/6.out | 3 +++ BZOJ/2299/data/7.in | 3 +++ BZOJ/2299/data/7.out | 3 +++ BZOJ/2299/data/8.in | 3 +++ BZOJ/2299/data/8.out | 3 +++ BZOJ/2299/data/9.in | 3 +++ BZOJ/2299/data/9.out | 3 +++ 23 files changed, 96 insertions(+) create mode 100644 BZOJ/2299/2299.cpp create mode 100644 BZOJ/2299/data/1.in create mode 100644 BZOJ/2299/data/1.out create mode 100644 BZOJ/2299/data/10.in create mode 100644 BZOJ/2299/data/10.out create mode 100644 BZOJ/2299/data/11.in create mode 100644 BZOJ/2299/data/11.out create mode 100644 BZOJ/2299/data/2.in create mode 100644 BZOJ/2299/data/2.out create mode 100644 BZOJ/2299/data/3.in create mode 100644 BZOJ/2299/data/3.out create mode 100644 BZOJ/2299/data/4.in create mode 100644 BZOJ/2299/data/4.out create mode 100644 BZOJ/2299/data/5.in create mode 100644 BZOJ/2299/data/5.out create mode 100644 BZOJ/2299/data/6.in create mode 100644 BZOJ/2299/data/6.out create mode 100644 BZOJ/2299/data/7.in create mode 100644 BZOJ/2299/data/7.out create mode 100644 BZOJ/2299/data/8.in create mode 100644 BZOJ/2299/data/8.out create mode 100644 BZOJ/2299/data/9.in create mode 100644 BZOJ/2299/data/9.out diff --git a/BZOJ/2299/2299.cpp b/BZOJ/2299/2299.cpp new file mode 100644 index 00000000..8ff83cc0 --- /dev/null +++ b/BZOJ/2299/2299.cpp @@ -0,0 +1,30 @@ +#include +#include + +using std::cin; +using std::cout; +const char endl = '\n'; + +int t, a, b, x, y; + +int main() { + std::ios::sync_with_stdio(false); + cin.tie(nullptr); + + cin >> t; + + while (t--) { + cin >> a >> b >> x >> y; + + int g = std::__gcd(a, b) * 2; + a %= g, b %= g, x %= g, y %= g; + + auto check = [&](int x, int y) -> bool { + return x % g == 0 && y % g == 0; + }; + + cout << (check(x, y) || check(x + a, y + b) || check(x + b, y + a) || check(x + a + b, y + a + b) ? "Y" : "N") << endl; + } + + return 0; +} diff --git a/BZOJ/2299/data/1.in b/BZOJ/2299/data/1.in new file mode 100644 index 00000000..adfa4997 --- /dev/null +++ b/BZOJ/2299/data/1.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:afbb3d1f63280195edccb5e4006230f1565afdcc7a28902032199b4ce87b87a9 +size 31 diff --git a/BZOJ/2299/data/1.out b/BZOJ/2299/data/1.out new file mode 100644 index 00000000..72e7d25f --- /dev/null +++ b/BZOJ/2299/data/1.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cacdd7ecaa246743167332ecabae20c3e0749663268d56dd1f3d904bb1b474b2 +size 6 diff --git a/BZOJ/2299/data/10.in b/BZOJ/2299/data/10.in new file mode 100644 index 00000000..4b765b10 --- /dev/null +++ b/BZOJ/2299/data/10.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:82ef2f1a38d61066485ee4ebb0ef69c05980825820ee1edc7f19e4a38a538d26 +size 20641 diff --git a/BZOJ/2299/data/10.out b/BZOJ/2299/data/10.out new file mode 100644 index 00000000..26d7e4ef --- /dev/null +++ b/BZOJ/2299/data/10.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e407892c82158e31cc16eae41d266930e7a0522740107d521e1abf3bb5d1400d +size 2000 diff --git a/BZOJ/2299/data/11.in b/BZOJ/2299/data/11.in new file mode 100644 index 00000000..69a7931f --- /dev/null +++ b/BZOJ/2299/data/11.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:92ccd381412639403a39f4c16a1dd072fdb42ff1ff542b3326da2a5c2a9d899d +size 587984 diff --git a/BZOJ/2299/data/11.out b/BZOJ/2299/data/11.out new file mode 100644 index 00000000..b1a6722d --- /dev/null +++ b/BZOJ/2299/data/11.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:742744d36cddd84678588320a646dede5daf08f357b4549d3dd4b8503d18b8c8 +size 40000 diff --git a/BZOJ/2299/data/2.in b/BZOJ/2299/data/2.in new file mode 100644 index 00000000..34b2e5eb --- /dev/null +++ b/BZOJ/2299/data/2.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ba49dcce49d74b955c2bee8911c2b230305eef34d0456ba73d7abc027b293472 +size 634877 diff --git a/BZOJ/2299/data/2.out b/BZOJ/2299/data/2.out new file mode 100644 index 00000000..957bafc9 --- /dev/null +++ b/BZOJ/2299/data/2.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0c7cf34521a146275d515a86516ce285772ddaa1e88a17f9fb833524904f64fc +size 40000 diff --git a/BZOJ/2299/data/3.in b/BZOJ/2299/data/3.in new file mode 100644 index 00000000..def34f37 --- /dev/null +++ b/BZOJ/2299/data/3.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e574b1dc22d30a3b1945da74314c8d570d6dcddf66ce44fcf0e86ced90a6360a +size 618810 diff --git a/BZOJ/2299/data/3.out b/BZOJ/2299/data/3.out new file mode 100644 index 00000000..62b1d7a6 --- /dev/null +++ b/BZOJ/2299/data/3.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fddbe084cb87f57b2bf3eba9e4c5536c6f34530439026efd82d75007c8dfbbf3 +size 40000 diff --git a/BZOJ/2299/data/4.in b/BZOJ/2299/data/4.in new file mode 100644 index 00000000..641f8875 --- /dev/null +++ b/BZOJ/2299/data/4.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d4d4cfd474a6a256f4b987706d1019fc10d359ec12cfe4b1c837fc0a9dced0ce +size 115 diff --git a/BZOJ/2299/data/4.out b/BZOJ/2299/data/4.out new file mode 100644 index 00000000..cab6d704 --- /dev/null +++ b/BZOJ/2299/data/4.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6471134f02899b400b185381b075ae063218c1e2676c37f8c6f11aff86274f97 +size 22 diff --git a/BZOJ/2299/data/5.in b/BZOJ/2299/data/5.in new file mode 100644 index 00000000..07c2fb80 --- /dev/null +++ b/BZOJ/2299/data/5.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:66ea48fa585daf8d926a20c20ee1ccee0278b5d9073e1adae00bdfbac9a33a6f +size 697192 diff --git a/BZOJ/2299/data/5.out b/BZOJ/2299/data/5.out new file mode 100644 index 00000000..66ec4506 --- /dev/null +++ b/BZOJ/2299/data/5.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1a675b24b3fe584aaa245b65809173d59054794660ff282db7ca58bf3504d3e1 +size 40000 diff --git a/BZOJ/2299/data/6.in b/BZOJ/2299/data/6.in new file mode 100644 index 00000000..224a25fc --- /dev/null +++ b/BZOJ/2299/data/6.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:328f4a2f5ad149d30c5eee10caff3e9ecada6fd484c178896041d45f7ee8968c +size 1403 diff --git a/BZOJ/2299/data/6.out b/BZOJ/2299/data/6.out new file mode 100644 index 00000000..fde0b73d --- /dev/null +++ b/BZOJ/2299/data/6.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5dfddc73e98cd2af67726b6539f9c581f3c8be28cd7ea876552e0886f0cfc19a +size 200 diff --git a/BZOJ/2299/data/7.in b/BZOJ/2299/data/7.in new file mode 100644 index 00000000..768943da --- /dev/null +++ b/BZOJ/2299/data/7.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c910ecb3bb3f759ab5dd5ffb51b4aa706c5482c7e721d2419351976404ec0d63 +size 602 diff --git a/BZOJ/2299/data/7.out b/BZOJ/2299/data/7.out new file mode 100644 index 00000000..65157df9 --- /dev/null +++ b/BZOJ/2299/data/7.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:41b96b86c24124f092b24a5787f10702de2a033450ffabdc4aaa51636efc6937 +size 100 diff --git a/BZOJ/2299/data/8.in b/BZOJ/2299/data/8.in new file mode 100644 index 00000000..f6e15701 --- /dev/null +++ b/BZOJ/2299/data/8.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b0d53871875616f2979e95ea16c54fb08f9e10cfea5245d1007038e8a9ccdab8 +size 215138 diff --git a/BZOJ/2299/data/8.out b/BZOJ/2299/data/8.out new file mode 100644 index 00000000..09d6447f --- /dev/null +++ b/BZOJ/2299/data/8.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc058ecf8a1cf050f8adc9ceeccdf8a76d6428df6128f374b247fb06d5bab28c +size 20000 diff --git a/BZOJ/2299/data/9.in b/BZOJ/2299/data/9.in new file mode 100644 index 00000000..5558e74a --- /dev/null +++ b/BZOJ/2299/data/9.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f8d5fecd77bf181b7fa11f17cc7da4e21f08bce0736606ed43eca993da7c8be8 +size 699489 diff --git a/BZOJ/2299/data/9.out b/BZOJ/2299/data/9.out new file mode 100644 index 00000000..a89fa62a --- /dev/null +++ b/BZOJ/2299/data/9.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:50c174ff929c535edb7fe6ada26159a0a2aac66296f2a0a086e435c63d5d6525 +size 40000