sum of pairs and sum of fisrt-last