QUERY BIT Logic Checking, Provide Failing Case if possible

i Calculate the left and right child answer then i combine as;
parent = left + right*2^LengthOfLeftChild
i used indexing from last as opposed to what is mentioned in the question. so when i take input i made sure i modify the input before passing the range values.
Please Check the code. It works on the test cases provided but gives wrong answer when submitting.
I also used lazy updates please check if the code for lazy updates is correct or not.

Code Link: https://ide.codingblocks.com/s/109875

@Saurabh-Kumar-1331476656958199
Thank You.

void lazy_up(int node,int st,int en)
{
    if(lz[node]!=-1)
    {
        t[node]=(pow(2,en-st+1,mod)-1)*lz[node];
        if(st!=en)
        {
            lz[node*2+1]=lz[node];
            lz[node*2+2]=lz[node];
        }
        lz[node]=-1;
    }
}
​
void update(int node,int st,int en,int l,int r,int x)
{
    lazy_up(node,st,en); //updating pending lazy updates.
    if(st>r || en<l)
        return;
    if(st>=l && en<=r)
    {
        t[node]=(pow(2,en-st+1,mod)-1)*x;
        if(st!=en)
        {
            lz[node*2+1]=x;
            lz[node*2+2]=x;
        }
        return;
    }
    int mid=st+en>>1;
    update(node*2+1,st,mid,l,r,x);
    update(node*2+2,mid+1,en,l,r,x);
    t[node]=(t[node*2+1]*pow(2,en-mid,mod)%mod+t[node*2+2])%mod; //merging children to form parent
}
​
ll query(int node,int st,int en,int l,int r)
{
    lazy_up(node,st,en); //updating pending lazy updates.
    if(st>r || en<l)
        return 0;
    if(st>=l && en<=r)
    {
        return t[node];
    }
    int mid=st+en>>1;
    int p1=query(node*2+1,st,mid,l,r);
    int p2=query(node*2+2,mid+1,en,l,r);
    if(r<=mid)
        return p1;
    return (p1*pow(2,min(en,r)-mid,mod)%mod+p2)%mod;
}

try to find out error once more in your code by understanding this code …