The cost of 5 tables and 20 chairs is $4865. The cost of 7 tables and 40 chairs is $7780. Find the cost of each table (t) and each chair (c).