Polyak-Viro type formulas for high-(co)dimensional smooth knots and links