From 67cf3c995d6e0328cdffb1b99c56f7a3ad8626b2 Mon Sep 17 00:00:00 2001 From: Ren Baoshuo Date: Sat, 30 Oct 2021 19:11:30 +0800 Subject: [PATCH] =?UTF-8?q?#1118.=20[CSP-J=202021]=20=E5=88=86=E7=B3=96?= =?UTF-8?q?=E6=9E=9C=EF=BC=88=E6=B0=91=E9=97=B4=E6=95=B0=E6=8D=AE=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://sjzezoj.com/submission/41761 --- S2OJ/1118/1118.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 S2OJ/1118/1118.cpp diff --git a/S2OJ/1118/1118.cpp b/S2OJ/1118/1118.cpp new file mode 100644 index 00000000..522460c8 --- /dev/null +++ b/S2OJ/1118/1118.cpp @@ -0,0 +1,11 @@ +#include + +using namespace std; + +int n, l, r; + +int main() { + cin >> n >> l >> r; + cout << min((int)(ceil(1.0 * l / n) * n + n - 1), r) % n << endl; + return 0; +}