aboutsummaryrefslogtreecommitdiff
path: root/c/las12uvas
diff options
context:
space:
mode:
Diffstat (limited to 'c/las12uvas')
-rw-r--r--c/las12uvas/480_cuantasPido.cpp16
1 files changed, 16 insertions, 0 deletions
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 <iostream>
+
+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;
+ }
+}