My issue
what’s wrong with my code?
It is showing that i missed a hidden test case
My code
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;int k;
cin>>t;
// your code goes here
for(int i=1;i<=t;i++){
int maxt,maxn,sumn;
cin>>maxt>>maxn>>sumn;
int itr=0;
if(sumn%maxn==0){
if(sumn/maxn <= maxt){
k=sumn/maxn;
for(int j=1;j<=k;j++){
itr=itr+(maxn*maxn);
}}
else{
k=maxt;
for(int j=1;j<=k;j++){
itr=itr+(maxn*maxn);
}
}
cout<<itr<<endl;}
else{
for(int j=1;j<=sumn/maxn;j++){
itr=itr+(maxn*maxn);
}
itr=itr+pow(sumn%maxn,2);
cout<<itr<<endl;
}
}
}
Problem Link: Slow Solution Practice Coding Problem