Solution to the problem number 340 of AceptaelReto - 340.

Any questions do not hesitate to contact.

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,casos;
        cin>>casos;
    while(casos--)
    {
        cin>>n>>m;
        cout<< (n*(2*m+1)+m)<<"\n";
    }
    return 0;
}

Don't miss anything.

Keep in touch with Isaac Lozano Osorio!