From 31fb41720d55aec37b4907cfcf4c2c0f8be75646 Mon Sep 17 00:00:00 2001 From: Jasna Suresh Date: Fri, 30 Oct 2020 20:54:48 +0530 Subject: [PATCH] Added ChocolateFeast.cpp --- ChocolateFeast.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 ChocolateFeast.cpp diff --git a/ChocolateFeast.cpp b/ChocolateFeast.cpp new file mode 100644 index 0000000..4dad82d --- /dev/null +++ b/ChocolateFeast.cpp @@ -0,0 +1,20 @@ +#include + +using namespace std; + +int main(){ + + int a,b,c,d,ans = 0; + cin >> a; + while(a--){ + cin >> b >> c >> d; + int tmp = ans = b/c; + while(tmp >= d){ + ans++; + tmp-=d; + tmp++; + } + cout << ans << endl; + } + return 0; +}