package main import "fmt" func roomNumber(num int, slc *[]int){ for i := 0; i < num; i++{ var val int fmt.Scan(&val) *slc = append(*slc, val) } } func removeDuplicate(args []int) []int{ results := make([]int, 0, len(args)) encountered := map[int]bool{} for i := 0; i < len(args); i++{ if !encountered[args[i]] { encountered[args[i]] = true results = append(results, args[i]) } } return results } func main(){ var yuki, transfer, num int fmt.Scan(&yuki, &transfer, &num) slc := []int{} roomNumber(num, &slc) duplication := len(slc) - len(removeDuplicate(slc)) fmt.Println( duplication * (yuki + transfer) ) }