QUESTION ON MATH

Batman and Robin are on a mission. Their is a bomb which they want to diffuse but the problem is they have to solve a task first which is very difficult for

As you are their friend, they ask you to solve the problem for them.

You are given a pair (A, B). After each operation pair (A, B) gets changed to (B-2A, 28 +A).

You are given the initial value of A and B you have to find and return the value of pair after the operation
output ans as mod 10^9 + 7

pls solve this ques i am getting error in one of the test case

my solution is-:
#include
#include
#include

using namespace std;

int main()
{
int a,b,c;
cin>>a>>b>>c;
int d,h;
int d1;
int d2;

int mod = pow(10,9) + 7;
for(int i=0;i<c;i++)
{
  d = a;
  h = b;
  d1 = 2*d;
  d2 = 2*h;
  a = h % mod - (d1 % mod);
  b = (d2 % mod) + d % mod;
}
cout<<a<<" "<<b;

return 0;

}

Can u provide me the question link

Your modulo arithmetic is wrong as (x + y)%z is not x%z + y%z since that could add up to more than z, and (x-y)%z is not x%z - y%z since that could be less that zero.