the last term is 45 and the sum of all its terms is 400. Find the number of terms and the common difference.