Untitled

 avatar
user_1164828
plain_text
a month ago
519 B
0
Indexable
Never
//Checking Cube

#include<iostream>
using namespace std;

int N;
int n;
int ans = 0;
//int s;

void BT(int k, int n){
	if(N == 0){
		ans++;
		return;
	}
	if(k == 5){
		return;
	}
	for(int i=n; i >= 0; i--){
		if(N - i*i*i >=0){
			N -= i*i*i;
			BT(k+1, i);
			N += i*i*i;
		}
	}
}

int main(){
	//freopen("Text.txt", "r", stdin);
	int T;
	cin >> T;
	for(int tc = 1; tc <= T; tc++){
		cin >>N;
		for(int i=0; i*i*i <=N; i++){
			n = i;
		}
		ans = 0;
		BT(0,n);
		cout <<"#" << tc << " " << ans << endl;
	}
	return 0;
}
Leave a Comment