#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>


int main(int argc, char **argv){
	const uint8_t d_num = 10;
	uint64_t d_size[d_num]  = {512, 256, 128, 128, 128, 128, 128, 128, 128, 128};
	uint64_t d_write[d_num] = {2100, 550, 215, 215, 200, 200, 200, 160, 100, 100};
	uint64_t d_read[d_num]  = {3500, 550, 430, 430, 200, 200, 200, 185, 100, 100};
	uint64_t combined_write = 0;
	uint64_t combined_read = 0;
	double percent_of_write[d_num];
	double percent_of_read[d_num];
	uint8_t num1, num2, num3, num4;
	uint8_t d_max_partitions = 128;
	uint64_t bucket_size = 0;
	uint64_t bucket_write = 0;
	uint64_t bucket_read = 0;
	uint64_t 

	for(num1=0; num1<d_num; num1++){
		combined_write += d_write[num1];
		combined_read  += d_read[num1];
	}
	for(num1=0; num1<d_num; num1++){
		percent_of_write[num1] = d_write[num1]/combined_write;
		percent_of_write[num1] *= 100;
		percent_of_read[num1] = d_read[num1]/combined_read;
		percent_of_read[num1] *= 100;
	}
	//calculate number of partitions
	//cycle through all possible permutations of upto 128partitions/drive, for each drive, selecting max sub drive partitions such that bucket_write/read >= sub bucket write/read, and choose fastest total
	for(num1=0; num1<d_num; num1++){
		for(num2=d_max_partitions; num>0; num2--){
				bucket_size = d_size[num1]/num2;
				bucket_write = d_write[num1]/num2;
				bucket_read = d_read[num1]/num2;
				//skip bucket sizes larger than smallest drive
				
				for(num3=0; num3<d_max_partitions; num3++){
					//bucket speed for rest of drives must be greater
					
				}
	}


	//output
	//best read
		//drive_num partitions size_each
		//total partitions/space
		//estimated total read/write max
	//best write
		//drive_num partitions size_each
		//total partitions/space
		//estimated total read/write max

	

	return 0;
}
