package main import . "fmt" import sl "slices" import . "math/bits" func main() { var n int Scan(&n) a:=make([]int,n) b:=make([]int,n) for i:=range a { Scan(&a[i]) } for i:=range b { Scan(&b[i]) } sl.Sort(a) dp:=make([][]int,n+1) for i:=range dp { dp[i]=make([]int,1<z { s=v z=x } else if x==z { s+=v } } Println(s) }