import math


def get_rows_cols_for_subplot(num_subplots:int)->tuple:
    """
    This function calculates the rows and cols required
    for the subplot..
    
    Args:
        num_subplots:int
    
    Returns:
        nrows:int
        ncols:int
        odd:bool
    """
    
    try:
        nrows=ncols=0
        odd=False
        
        if num_subplots%2==0 and num_subplots!=2:
            nrows=ncols=round(num_subplots/2)
        elif num_subplots==2:
            nrows=1
            ncols=2
        else:
            nrows=ncols=math.ceil(num_subplots/2)
            odd=True
            
        return nrows,ncols,odd
    except Exception as error:
        raise Exception('Caught this error: ' + repr(error))