.
The usual practice in hotels is to pay for night.
But, specially for the purpose of this problem, I will assume that they pay for each DAY and that the number of days was 14 ("two weeks" literally).
Solution
Let P be the number of days in Philly.
Then the number of days in NYC is 3P, from the condition.
We also are given that the number of days in NYC, 3P, is equal to B + W.
So we have
P + 3P + (B + W) = 14, or, replacing B + W by "3P",
P + 3P + 3P = 14,
7P = 14 ====> P = = 2.
Answer. 2 days in P; 6 days in NYC; and remaining 14 - (2+6) = 6 days in B + W.
It is how my logic works.
Still, it is not the final solution yet, but I just reduced the problem to the only 2 (two, TWO) unknowns B and W,
and at this point, I an sure, now you are able to complete the solution WITHOUT MY HELP,
using REMAINING CONDITION on the total cost.