Language: C++

using System;
using System.Collections.Generic;
using System.Linq;
class abc165_d{
  public static void Main(){
    String[] str = Console.ReadLine().Split(' ');
    ulong a = ulong.Parse(str[0]);
    ulong b = ulong.Parse(str[1]);
    ulong n = ulong.Parse(str[2]);
    ulong ans = 0, min, max;
    for(ulong x = 0; x <= n; x++){
      min = x/b;
      max = a*x/b;
      ulong temp = max-min*a;
      if(ans < temp)
        ans = temp;
    }
    Console.WriteLine(ans);
  }
}


Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.Linq;
      |       ^~~~~~
a.cc:5:9: error: expected ':' before 'static'
    5 |   public static void Main(){
      |         ^~~~~~~
      |         :
a.cc:20:2: error: expected ';' after class definition
   20 | }
      |  ^
      |  ;
a.cc: In static member function 'static void abc165_d::Main()':
a.cc:6:5: error: 'String' was not declared in this scope
    6 |     String[] str = Console.ReadLine().Split(' ');
      |     ^~~~~~
a.cc:6:12: error: expected primary-expression before ']' token
    6 |     String[] str = Console.ReadLine().Split(' ');
      |            ^
a.cc:7:5: error: 'ulong' was not declared in this scope; did you mean 'long'?
    7 |     ulong a = ulong.Parse(str[0]);
      |     ^~~~~
      |     long
a.cc:8:11: error: expected ';' before 'b'
    8 |     ulong b = ulong.Parse(str[1]);
      |           ^
a.cc:9:11: error: expected ';' before 'n'
    9 |     ulong n = ulong.Parse(str[2]);
      |           ^
a.cc:10:11: error: expected ';' before 'ans'
   10 |     ulong ans = 0, min, max;
      |           ^~~
a.cc:11:15: error: expected ';' before 'x'
   11 |     for(ulong x = 0; x <= n; x++){
      |               ^
a.cc:11:22: error: 'x' was not declared in this scope
   11 |     for(ulong x = 0; x <= n; x++){
      |                      ^
a.cc:11:27: error: 'n' was not declared in this scope
   11 |     for(ulong x = 0; x <= n; x++){
      |                           ^
a.cc:12:7: error: 'min' was not declared in this scope
   12 |       min = x/b;
      |       ^~~
a.cc:12:15: error: 'b' was not declared in this scope
   12 |       min = x/b;
      |               ^
a.cc:13:7: error: 'max' was not declared in this scope
   13 |       max = a*x/b;
      |       ^~~
a.cc:13:13: error: 'a' was not declared in this scope
   13 |       max = a*x/b;
      |             ^
a.cc:14:13: error: expected ';' before 'temp'
   14 |       ulong temp = max-min*a;
      |             ^~~~
a.cc:15:10: error: 'ans' was not declared in this scope
   15 |       if(ans < temp)
      |          ^~~
a.cc:15:16: error: 'temp' was not declared in this scope
   15 |       if(ans < temp)
      |                ^~~~
a.cc:18:5: error: 'Console' was not declared in this scope
   18 |     Console.WriteLine(ans);
      |     ^~~~~~~
a.cc:18:23: error: 'ans' was not declared in this scope
   18 |     Console.WriteLine(ans);
      |                       ^~~