From c21c8f3d3a9cc24fe62e737630b697c568435cf2 Mon Sep 17 00:00:00 2001 From: InigoGutierrez Date: Wed, 29 May 2019 16:00:04 +0200 Subject: =?UTF-8?q?Resuelto=20480=20en=20c++:=20Cu=C3=A1ntas=20pido.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- c/las12uvas/480_cuantasPido.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 c/las12uvas/480_cuantasPido.cpp (limited to 'c/las12uvas') diff --git a/c/las12uvas/480_cuantasPido.cpp b/c/las12uvas/480_cuantasPido.cpp new file mode 100644 index 0000000..2b1ed03 --- /dev/null +++ b/c/las12uvas/480_cuantasPido.cpp @@ -0,0 +1,16 @@ +#include + +using namespace std; + +int main() { + int cases; + int grapes, bad, group; + cin >> cases; + for (int i = 0; i < cases; i++) { + cin >> grapes; + cin >> bad; + cin >> group; + //cout << "Grapes/group case " << i << ": " << grapes/group << endl; + cout << (grapes/group)*bad + min(grapes%group, bad) << endl; + } +} -- cgit v1.2.1