#include<iostream>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<iomanip>
using namespace std;

int main()
{
	char code[10];
	char w[3]; //width

	
	char l[3];//length
	float length,lengthf; //length
	
	char p[5]; // price
	float price;
	
	float size, width,widthf,roomW, roomL, room,sizeroom,cost;

	
	cout << fixed<< setprecision(2);
	cout << "Please enTer linoleum code: ";
	cin>> code;
	
	for(int i=0; i<2; i++) //width
	w[i]=code [i+1];
	w[2]= '\0';
	
	for(int j=0; j<2; j++) //length
	l[j]=code [j+3];
	l[2]= '\0';
	
	for(int x =0; x<4;x++) //price
	p[x]= code[x+5];
	p[4] = '\0';
	

	width = atof(w); //width
	length = atof(l); //length
	price = atof(p); //price
	
	price = price/100; //rpice from cent to RM
	widthf=width/12; //width from inches to feet
	lengthf=length/12; //length from inches to feet
	size = widthf*lengthf; 
	
 
 cout << "Linoleum size: "<< widthf << " Feet x " << lengthf << " Feet" << endl;    
 cout << "Linoleum price: RM"<< price <<endl;
 
 cout <<"Enter the width and length of the room: ";
 cin>> roomW >> roomL;
 
 room=roomW*roomL; //calculate tge size of the room
 
 cout << "Size of room: "<<room << " sqft" <<endl;
 
 sizeroom=room/size;
 cout << "Number of linoleum "<< static_cast<int>(ceil(sizeroom)) <<" pieces" <<endl;
 
 cost= price*static_cast<int>(ceil(sizeroom));
 cout << "Cost: RM"<< cost;
 
 
    
	return 0; 
}
