Runtime error in the above problem code

Hello sir, I have tried to code the solution myself after understanding the logic but though it gave the current result on the sample input test when I tried to submit the given code on spoj it’s giving a runtime error can you please guide me so that I could make changes so that it could work.

code :-
#include
#include <bits/stdc++.h>
#define ll long long int
using namespace std;

int main()
{

ll t;
cin>>t;
while(t--)
{
   int a,b,c;
   cin>>a>>b>>c;
   int arr[100000];
   int brr[100000];
   for(int i=0;i<c;i++)
   {
      cin>>arr[i];
      cin>>brr[i];
       
   }
   sort(arr,arr+c);
   sort(brr,brr+c);
   
   vector<int>v1;
   vector<int>v2;
   
   int ans1=0;
   int ans2=0;
   
  for(int i=0;i<c;i++)
  {
      int k=arr[i]-ans1-1;
      v1.push_back(k);
      ans1=arr[i];
  }
  v1[c]=a-arr[2];
  
  for(int i=0;i<c;i++)
  {
      int l=brr[i]-ans2-1;
      v2.push_back(l);
      ans2=brr[i];
  }      
  v2[c]=b-brr[2];
  
  // sorting both the vecttors to get the largest element
  sort(v1.begin(),v1.end());
  sort(v2.begin(),v2.end());
  
  cout<<v1.back()*v2.back();
}
//asquare();
return 0;

}

SIR CAN YOU PLEASE ANSWER MY ABOVE QUERY

v1[c]=a-arr[2]
V1 size will be c because you inserted c elements in it so this will be out of bounds

Also you’re declaring a huge array inside main function this can also be an issue. Use global variables for large arrays as stack memory is limited.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.