package main import . "fmt" import . "slices" func main() { var n,m int Scan(&n,&m) x:=make([]int,n) y:=make([]int,m) for i:=range x { Scan(&x[i]) } for i:=range y { Scan(&y[i]) } Sort(y) for _,v:=range x { z,ok:=BinarySearch(y,v) if !ok&&z>=m { Println("Infinity") } else { Println(y[z]-v) } } }