Isint this code right for merging two linked list

#include
#include
using namespace std;
int main()
{
int t;
cin >> t;
for(int i = 0;i <= t-1;i++)
{

int n,m,k;
cin >> n;

list<int> l1,l2,l3;

for(int i = 0;i <= n-1;i++)
{
     cin >> k;
     l1.push_back(k);
}
cin >> m; 

for(int j = 0;j <= m-1;j++)
{
     cin >> k;
     l2.push_back(k);
}
l1.sort();
l2.sort();

auto it1 = l1.begin(),it2 = l2.begin(),it3 = l3.begin();
int c1 = 0,c2 = 0;

for(it1 = l1.begin(), it2 = l2.begin(); it1 != l1.end() && it2 != l2.end();)
{

    if(*it1 < *it2)
    {
         l3.push_back(*it1);
         it1++;
         it3++;
         c1++;
    }
    else if(*it1 > *it2)
    {
         l3.push_back(*it2);
         it2++;
         it3++;
         c2++;
    }
    else
    {   
        l3.push_back(*it1);
        it1++;
        it2++;
        it3++;
        c1++;
        c2++;
    }


}
if(c1 < n)
{
     while(c1 < n)
     {
          l3.push_back(*it1);
          it1++;
          it3++;
          c1++;
     }
}


if(c2 < m)
{
     while(c2 < m)
     {
          l3.push_back(*it2);
          it2++;
          it3++;
          c2++;
     }
}

for(auto i:l3)
{
     cout << i << " ";
}
cout << "\n";

}

}

hello @israina27

In this section of ur code ,u are inserting only it1 , so increment only it1.
dont increment it2 ans c2.