Help me in solving MANCODE problem

My issue

what happens, if the number is even?

My code

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

int main() {
	// your code goes here
	
	int t;
	
	cin >> t;
	
	while(t--)
	{
	    int n;
	    cin >> n;
	    
	    int max = ((n/2) + (n%2));
	    int min = n/2;
	    
	    cout << max << " " << min << endl;
	}

}

Problem Link: The Man Code Practice Coding Problem - CodeChef

@harshada_09
your logic is not right
plzz refer my c++ code

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

int main() {
	// your code goes here
	int t;
	cin>>t;
	while(t--)
	{
	    int n;
	    cin>>n;
	    if(n%2==0)
	    {
	        cout<<n/2<<" "<<ceil(n*1.0/3*1.0);
	        
	    }
	    else
	    {
	        cout<<(n+1)/2<<" "<<ceil(n*1.0/3*1.0);
	    }
	    cout<<endl;
	}

}