One tank holds 300 litres more than another. If the smaller is two-thirds full, it holds as much as the larger when it is half full. What is the capacity of each?