Help me in solving COLOR8TEST problem

My issue

why am I getting wrong output here?

My code

#include <bits/stdc++.h>
using namespace std;

int main() {
	// your code goes here
	int t;
	cin>>t;
	while(t--)
	{
	    long long int X1,X2,X3,X4,X5,X6;
	    cin>>X1>>X2>>X3>>X4>>X5>>X6;
	    long long int N;
	    cin>>N;
	    long long int cost=((X1+X2+X3+X4+X5+X6)*0.5);
	    int k=cost*N;
	    cout<<k<<endl;
	    
	}
	return 0;

}

Learning course: Prepare for your DSA interviews
Problem Link: Color the Cube Practice Problem in Prepare for your DSA interviews - CodeChef

@harsh_govil
plzz refer my c++ code

#include <bits/stdc++.h>
using namespace std;

int main() {
	// your code goes here
	int t;
	cin>>t;
	while(t--)
	{
	    long long int a[7];
	    for(int i=0;i<7;i++)
	    {
	        cin>>a[i];
	        
	    }
	    long long int sm=0;
	    for(int i=1;i<7;i++)
	    sm+=a[i];
	    long long int ans=ceil(a[0]*1.0/2*1.0);
	    ans=ans*sm;
	    cout<<ans<<endl;
	}

}