diff --git a/BZOJ/3834/3834.cpp b/BZOJ/3834/3834.cpp new file mode 100644 index 00000000..3fd15c76 --- /dev/null +++ b/BZOJ/3834/3834.cpp @@ -0,0 +1,27 @@ +#include + +using std::cin; +using std::cout; +const char endl = '\n'; + +int n, a, b, c, d, ans; + +int main() { + std::ios::sync_with_stdio(false); + cin.tie(nullptr); + + cin >> n; + + while (n--) { + cin >> a >> b >> c >> d; + + for (int i = 1, j; i <= std::min(b, d); i = j + 1) { + j = std::min(b / (b / i), d / (d / i)); + if (b / j * j >= a && d / j * j >= c) ans = j; + } + + cout << ans << endl; + } + + return 0; +} diff --git a/BZOJ/3834/data/1.in b/BZOJ/3834/data/1.in new file mode 100644 index 00000000..44a497f9 --- /dev/null +++ b/BZOJ/3834/data/1.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:96d25bf2710a7daab798329f82d35bbd17f25db00336466ee7c95dd52e1ad484 +size 31243 diff --git a/BZOJ/3834/data/1.out b/BZOJ/3834/data/1.out new file mode 100644 index 00000000..4fd07ec6 --- /dev/null +++ b/BZOJ/3834/data/1.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c0330220360b02ecaefef8805fa535d741a4fae714ac572ad9f998790517b65a +size 6083 diff --git a/BZOJ/3834/data/10.in b/BZOJ/3834/data/10.in new file mode 100644 index 00000000..d9bd090f --- /dev/null +++ b/BZOJ/3834/data/10.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1bf626502a077150927ffe7967064f4bd7161c18b487caaa38ed945513eeada1 +size 31216 diff --git a/BZOJ/3834/data/10.out b/BZOJ/3834/data/10.out new file mode 100644 index 00000000..c9c0aa8a --- /dev/null +++ b/BZOJ/3834/data/10.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:45a286cdd2a3488c7eb89484f5fdd6128ef146750c38b76cd539d58fb00421e0 +size 6097 diff --git a/BZOJ/3834/data/11.in b/BZOJ/3834/data/11.in new file mode 100644 index 00000000..8e531b72 --- /dev/null +++ b/BZOJ/3834/data/11.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1a85ed2d27f955b9346dac002b10c0edc76d3f6146aec7fcc193489e30c7ebb7 +size 31200 diff --git a/BZOJ/3834/data/11.out b/BZOJ/3834/data/11.out new file mode 100644 index 00000000..4bb1de38 --- /dev/null +++ b/BZOJ/3834/data/11.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:afc43534f77e6ede7a9ea1f9e6fb6285801109740eb56617974252b04529432b +size 6085 diff --git a/BZOJ/3834/data/12.in b/BZOJ/3834/data/12.in new file mode 100644 index 00000000..24785970 --- /dev/null +++ b/BZOJ/3834/data/12.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fe74badcc08b0a54a30773eeecf194d9a228e4dbcb719ab400538e7b48dbb36a +size 309 diff --git a/BZOJ/3834/data/12.out b/BZOJ/3834/data/12.out new file mode 100644 index 00000000..7850cee8 --- /dev/null +++ b/BZOJ/3834/data/12.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:406dea114c5d3dd4863773ed9bbd3fc2652c01db2b817bf451bf9075b0af2882 +size 68 diff --git a/BZOJ/3834/data/13.in b/BZOJ/3834/data/13.in new file mode 100644 index 00000000..8c96409f --- /dev/null +++ b/BZOJ/3834/data/13.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0b77dd5588d281ded6a38de93fd747d1bd8c66d64641a66317802b4afc24a8df +size 29435 diff --git a/BZOJ/3834/data/13.out b/BZOJ/3834/data/13.out new file mode 100644 index 00000000..bb9829fa --- /dev/null +++ b/BZOJ/3834/data/13.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7b033467965b84f1c8b95c38c0bb512ec6f0d2b2d873ca13cc38967b08705806 +size 6990 diff --git a/BZOJ/3834/data/14.in b/BZOJ/3834/data/14.in new file mode 100644 index 00000000..1f6214c7 --- /dev/null +++ b/BZOJ/3834/data/14.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4e85c57bb65ee358ce55014971f807e8c64dbe144b9ac4090706a0cfac1938ff +size 41 diff --git a/BZOJ/3834/data/14.out b/BZOJ/3834/data/14.out new file mode 100644 index 00000000..321202c1 --- /dev/null +++ b/BZOJ/3834/data/14.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2897f3228ab675bdece9c15ed1948bda3a0e32219bd17a1e42f9ba4870d88c55 +size 8 diff --git a/BZOJ/3834/data/15.in b/BZOJ/3834/data/15.in new file mode 100644 index 00000000..310d74ca --- /dev/null +++ b/BZOJ/3834/data/15.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6d7bb23725778d47c5fa945bdf315b2baa9f802c687f82aa6769151f39a6faf1 +size 3109 diff --git a/BZOJ/3834/data/15.out b/BZOJ/3834/data/15.out new file mode 100644 index 00000000..6481b774 --- /dev/null +++ b/BZOJ/3834/data/15.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:81ccdbe085eef942db5ee4358cbc91e44d040f4d5bdec056b74df1872134d366 +size 700 diff --git a/BZOJ/3834/data/16.in b/BZOJ/3834/data/16.in new file mode 100644 index 00000000..c02e27c8 --- /dev/null +++ b/BZOJ/3834/data/16.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:93432dcca14bf975deace46840b4ee4cccf2bf4a4a18812c4ab747ba76ffbfc7 +size 31188 diff --git a/BZOJ/3834/data/16.out b/BZOJ/3834/data/16.out new file mode 100644 index 00000000..62167744 --- /dev/null +++ b/BZOJ/3834/data/16.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:42a969b80fe70ae3bbfc94ef5c4e61f3bc5d2abb241dc304d82ef10be4e8f5a3 +size 6033 diff --git a/BZOJ/3834/data/17.in b/BZOJ/3834/data/17.in new file mode 100644 index 00000000..7b5a6071 --- /dev/null +++ b/BZOJ/3834/data/17.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dcd32a9e9486ba8aa5b4c487791a1cdbe99542070d0472fe2a5126ee43541b37 +size 29222 diff --git a/BZOJ/3834/data/17.out b/BZOJ/3834/data/17.out new file mode 100644 index 00000000..2902088e --- /dev/null +++ b/BZOJ/3834/data/17.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:216101372fe9c76982166c6a11263b4767151062ee1e9fde40aaa4de462305d3 +size 5458 diff --git a/BZOJ/3834/data/18.in b/BZOJ/3834/data/18.in new file mode 100644 index 00000000..a91c91dc --- /dev/null +++ b/BZOJ/3834/data/18.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0f2e974a6e3342684799d3aee895732f4ea770e8abe5146b856d98a6f95790a1 +size 313 diff --git a/BZOJ/3834/data/18.out b/BZOJ/3834/data/18.out new file mode 100644 index 00000000..0fa34fc3 --- /dev/null +++ b/BZOJ/3834/data/18.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:864e57098b74da68575814deaae4b059b7b321912c5cf771e333bc8873b26103 +size 68 diff --git a/BZOJ/3834/data/19.in b/BZOJ/3834/data/19.in new file mode 100644 index 00000000..fd056685 --- /dev/null +++ b/BZOJ/3834/data/19.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6ff1703663d64157c104721bdbc234c5d7581dde5a7e258761b1088e6585dd07 +size 3106 diff --git a/BZOJ/3834/data/19.out b/BZOJ/3834/data/19.out new file mode 100644 index 00000000..94a8babf --- /dev/null +++ b/BZOJ/3834/data/19.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0ad7c89aef218b20d5805a62e2f0290826835310476d4dc11bc89a6e04aabde8 +size 711 diff --git a/BZOJ/3834/data/2.in b/BZOJ/3834/data/2.in new file mode 100644 index 00000000..9043d658 --- /dev/null +++ b/BZOJ/3834/data/2.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cb4b4c78c961c015b6ee477fb04d2ed80ce89baff80d0d20b810561610f3dd96 +size 7317 diff --git a/BZOJ/3834/data/2.out b/BZOJ/3834/data/2.out new file mode 100644 index 00000000..04b307bc --- /dev/null +++ b/BZOJ/3834/data/2.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fb9adf304002824502a74189d38a2b654b629214f27e2a0cf34f2195b0a6a400 +size 1645 diff --git a/BZOJ/3834/data/3.in b/BZOJ/3834/data/3.in new file mode 100644 index 00000000..0675710f --- /dev/null +++ b/BZOJ/3834/data/3.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6d1f5e6907a696e82530a1a22c2a13744c66e1865d9507189e12d0239410cfb3 +size 29191 diff --git a/BZOJ/3834/data/3.out b/BZOJ/3834/data/3.out new file mode 100644 index 00000000..b373afd7 --- /dev/null +++ b/BZOJ/3834/data/3.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f92eec13c0666e73b1f0b04908a943c4c799bca83110267b173321822cb1ac03 +size 5476 diff --git a/BZOJ/3834/data/4.in b/BZOJ/3834/data/4.in new file mode 100644 index 00000000..a7712720 --- /dev/null +++ b/BZOJ/3834/data/4.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:948802b697dcbc7736e62b5a44a21ae144bca4bfa7e9ee19807bb41ce765bf9a +size 303 diff --git a/BZOJ/3834/data/4.out b/BZOJ/3834/data/4.out new file mode 100644 index 00000000..2e8a4c33 --- /dev/null +++ b/BZOJ/3834/data/4.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8b69e70b26158294ece93877efebbb04a258a2a8748d7f004f7b84692dfcdc62 +size 67 diff --git a/BZOJ/3834/data/5.in b/BZOJ/3834/data/5.in new file mode 100644 index 00000000..de0c1283 --- /dev/null +++ b/BZOJ/3834/data/5.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7a93ee3b21cb342191b77106eb298a1a9f01a29a37da69c2cfd3607cd62890a1 +size 7327 diff --git a/BZOJ/3834/data/5.out b/BZOJ/3834/data/5.out new file mode 100644 index 00000000..5efa359b --- /dev/null +++ b/BZOJ/3834/data/5.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e5a4343657a25673a558a2c79da964e29669af08e444b2e7a920f023b8f52a0e +size 1611 diff --git a/BZOJ/3834/data/6.in b/BZOJ/3834/data/6.in new file mode 100644 index 00000000..b3f4053a --- /dev/null +++ b/BZOJ/3834/data/6.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa42c50c6f4d1bd1b447fe97293571b9712d1e01a38898ce571e65f2153d6252 +size 29229 diff --git a/BZOJ/3834/data/6.out b/BZOJ/3834/data/6.out new file mode 100644 index 00000000..7740d14d --- /dev/null +++ b/BZOJ/3834/data/6.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:51a0fb3953eb5a1cec586664bb6afe7528f0f594a17743d586ca0f9f1ca52c25 +size 5495 diff --git a/BZOJ/3834/data/7.in b/BZOJ/3834/data/7.in new file mode 100644 index 00000000..576b78eb --- /dev/null +++ b/BZOJ/3834/data/7.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2c3e693f1c6dc82e115b2c1625d0c13f0431b9054083ff7460899cf220d3ffe1 +size 31808 diff --git a/BZOJ/3834/data/7.out b/BZOJ/3834/data/7.out new file mode 100644 index 00000000..f045669a --- /dev/null +++ b/BZOJ/3834/data/7.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ca148ffd8965f80ac38ee79f37a80dced6008603177bdcd177179f1de96fa6ff +size 6980 diff --git a/BZOJ/3834/data/8.in b/BZOJ/3834/data/8.in new file mode 100644 index 00000000..ecbbccaf --- /dev/null +++ b/BZOJ/3834/data/8.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:11ff2583ed46313a58052738470f96421f3dfd1519565487a2e724d63e07b253 +size 18250 diff --git a/BZOJ/3834/data/8.out b/BZOJ/3834/data/8.out new file mode 100644 index 00000000..be7b8af1 --- /dev/null +++ b/BZOJ/3834/data/8.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4502809dcd59568044d5b2143d33997c11122e53d69d6ec4d56ff561871bb505 +size 3986 diff --git a/BZOJ/3834/data/9.in b/BZOJ/3834/data/9.in new file mode 100644 index 00000000..294c4cd7 --- /dev/null +++ b/BZOJ/3834/data/9.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f798b485dcf11d02f45b29cee3b6199e5e2c4db7de46b4a3f2913416ec346415 +size 7336 diff --git a/BZOJ/3834/data/9.out b/BZOJ/3834/data/9.out new file mode 100644 index 00000000..c5e761dd --- /dev/null +++ b/BZOJ/3834/data/9.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a0de28abb18ed934141908f17f34c3b89329f479b67f66f884b914d06c6de3d8 +size 1573