Hi, I came across one question from codechef. [Click Here](http://www.codechef.com/problems/J7) Here, we are given P and S. Let l, b, h be the length, breadth, height of the box. we have these two inequalities 4*(l+b+h) <= P 2*(l*b+b*h+h*l) <= S We have to maximise the volume which is l*b*h. We are also given that test cases will produce optimal solution. Can any 1 please help me with it? +0 #include #include #include #include int compare(const void * a, const void * b) { return strcmp(a, b); } struct node { char name; int index; }; /* 1.Sort the Array cities (which was copy of A) and Array B2 (which was copy of B). 2.Do binary search in sorted array B (called B2) to find a city in A which is not present in B2. 3.If the index found is i, then print "A[i] B[i] cost[i]\$". 4.Do this for n - 2 times : For each B[indx], find it in sorted array cities and use its … +0 http://www.codechef.com/problems/NUKES I'm getting time limit exceeded in my code... Please some one help me out with this code. My algorithm is when A - ((N+1) ^ (p+1)) < 0 then pth chamber will have 1 particle and the new value of A in my recursive function is A - ((N+1) ^ p). This process will continue till A < N+1, then k will be A. #include #include int k; int N; /* if [A - (N + 1) ^ (p + 1) < 0], then pth chamber will have one particle and new value of A i.e. A' … +0 [CODE] #include #include #include using namespace std; int main() { // cout << "Hello world!" << endl; int t,i,j,a,flag; char str; cin>>t; while(t--) { a=1; scanf("%s",str); for(i=0;i<=strlen(str);i++) {flag=0; if(!isdigit(str[i])) {flag=0; for(j=i-1;isdigit(str[j]);j--) { if(str[j]!='0') { flag++; a*=str[j]-'0'; //cout<<"flag"<9) { if((a%10)!=0) { a=a%10; //cout<<"a"<

The End.