static void Main() { var n = long.Parse(Console.ReadLine()); var x = (FloorSqrtDec()(9 + 8 * n) - 1) / 2; Console.WriteLine(n + 1 - x); }
public static bool IsSquareNumberDec(decimal x) { decimal r = FloorSqrtDec()(x); return(r * r == x); }