[Csharp]
# Include <stdio. h>
Int main ()
{
Int y, m, d, sum, t, I;
Scanf ("% d", & t );
While (t --)
{
Scanf ("% d-% d", & y, & m, & d );
Sum = 0;
If (m = 2 & d = 29) // This day has no birthday
{
Printf ("-1 \ n ");
}
Else
{
For (I = y; I <= y + 18; I ++)
If (I = y & m <3 & (I % 400 = 0 | I % 4 = 0 & I % 100! = 0 ))
Sum ++;
Else if (I = y + 18 & m> = 3 & (I % 400 = 0 | I % 4 = 0 & I % 100! = 0 ))
Sum ++;
Else if (I> y & I <y + 18)
If (I % 400 = 0 | I % 4 = 0 & I % 100! = 0)
Sum ++;
Printf ("% d \ n", 365*18 + sum );
}
}
Return 0;
}
# Include <stdio. h>
Int main ()
{
Int y, m, d, sum, t, I;
Scanf ("% d", & t );
While (t --)
{
Scanf ("% d-% d", & y, & m, & d );
Sum = 0;
If (m = 2 & d = 29) // This day has no birthday
{
Printf ("-1 \ n ");
}
Else
{
For (I = y; I <= y + 18; I ++)
If (I = y & m <3 & (I % 400 = 0 | I % 4 = 0 & I % 100! = 0 ))
Sum ++;
Else if (I = y + 18 & m> = 3 & (I % 400 = 0 | I % 4 = 0 & I % 100! = 0 ))
Sum ++;
Else if (I> y & I <y + 18)
If (I % 400 = 0 | I % 4 = 0 & I % 100! = 0)
Sum ++;
Printf ("% d \ n", 365*18 + sum );
}
}
Return 0;
}