My issue
help…
My code
#include <iostream>
using namespace std;
int max_square(int b,int x){
int count=0;
if(x<2 || b<2 ){
return 0;
}
else{
count+=b/2;
return count;
}
max_square((b/2)*2,x-2);
}
// as let base present b and height x=b;
//no. of square in base b/2 ,and we do recurssion in next step base b=2*(b/2) and x=b-2 we do until didn't get any side <2 ---->b=2*(b/2) is basically size of base where square can accomodiate;
int main() {
// your code goes here
int t,b;
cin>>t;
while(t--){
cin>>b;
cout<<max_square(b,b)<<endl;
}
return 0;
}
Problem Link: TRISQ Problem - CodeChef