Help me in solving UWCOI20A problem

My issue

run time error

My code

#include <stdio.h>

int main(void) 
{
	// your code goes here
	int t,n;
	scanf("%d",&t);
	if(t<=10 && t>=0 )
	{
	    scanf("%d",n);
	    if(n>=1 && n<=100000)
	    {
	        int arr[n];
	        int max=0;
	        for(int i=0;i<n;i++)
	        {
	            scanf("%d",arr[i]);
	            if(n>=0 && n<=1000000000)
	            {
	            if(max>arr[i])
	            {
	                max=arr[i];
	            }
	        }
	            else 
	            break;
	        }
	        printf("%d",max);
	    }
	}

}


Learning course: Data structures & Algorithms lab
Problem Link: https://www.codechef.com/learn/course/muj-dsa-c/MUJDSAC06/problems/UWCOI20A