What went wrong in my code

My issue

My code

#include <iostream>
using namespace std;

     int n, m ; 
     int r ; 
     int t ; 
  
    int t1 ;
    unsigned long long int sum=0 ;
    unsigned long long int ans= 0 ;

int main() {
   
    cin >> t ; 
     
    while (t--)
    {
       
        
        sum = 0 ; 
        cin >> n >> m ; 
        
        for (int i= 0 ; i< m ; i++)
        {
            cin >> t1 ; 
            sum += t1 ; 
             
        }
         ans = (((n*(n+1))/2) - sum ) ; 
         cout <<  ans << endl ; 
    }
      return 0;
}

Problem Link: REMOVEMUL Problem - CodeChef

Facing the same issue. Used long long int. still got WA

This would solve your problem…

make everything long long