Language: C

use std::cmp;
use std::collections::BinaryHeap;
use std::collections::HashMap;
use std::collections::HashSet;
use std::collections::VecDeque;
use std::io::Read;
use std::usize::MAX;

macro_rules! input {(source = $s:expr, $($r:tt)*) => {let mut iter = $s.split_whitespace();let mut next = || { iter.next().unwrap() };input_inner!{next, $($r)*}};($($r:tt)*) => {let stdin = std::io::stdin();let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));let mut next = move || -> String{bytes.by_ref().map(|r|r.unwrap() as char).skip_while(|c|c.is_whitespace()).take_while(|c|!c.is_whitespace()).collect()};input_inner!{next, $($r)*}};}
macro_rules! input_inner {($next:expr) => {};($next:expr, ) => {};($next:expr, $var:ident : $t:tt $($r:tt)*) => {let $var = read_value!($next, $t);input_inner!{$next $($r)*}};}
macro_rules! read_value {($next:expr, ( $($t:tt),* )) => {( $(read_value!($next, $t)),* )};($next:expr, [ $t:tt ; $len:expr ]) => {(0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()};($next:expr, chars) => {read_value!($next, String).chars().collect::<Vec<char>>()};($next:expr, usize1) => {read_value!($next, usize) - 1};($next:expr, [ $t:tt ]) => {{let len = read_value!($next, usize);(0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()}};($next:expr, $t:ty) => {$next().parse::<$t>().expect("Parse error")};}

fn solve() {
    input! {
        n: usize,
        m: usize,
        a: [usize;m]
    }

    let mut total = 0;
    for i in 0..m {
        total += a[i];
    }

    if n >= total {
        println!("{}", n - total);
    } else {
        println!("-1");
    }
}

fn main() {
    let thd = std::thread::Builder::new().stack_size(104_857_600);
    thd.spawn(|| solve()).unwrap().join().unwrap();

    /*
    // 入力を一括で読み込む場合
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();
    let mut input = buf.split_whitespace();

    // inputに対しnext()で読み込んでいく
    let q: usize = input.next().unwrap().parse().unwrap();
    */
}

const LARGE_PRIME: u64 = 1_000_000_007;

// @〜でsnippet


Compiler output:
main.c:1:1: error: unknown type name 'use'
    1 | use std::cmp;
      | ^~~
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '::' token
    1 | use std::cmp;
      |        ^~
main.c:2:1: error: unknown type name 'use'
    2 | use std::collections::BinaryHeap;
      | ^~~
main.c:2:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '::' token
    2 | use std::collections::BinaryHeap;
      |        ^~
main.c:3:1: error: unknown type name 'use'
    3 | use std::collections::HashMap;
      | ^~~
main.c:3:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '::' token
    3 | use std::collections::HashMap;
      |        ^~
main.c:4:1: error: unknown type name 'use'
    4 | use std::collections::HashSet;
      | ^~~
main.c:4:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '::' token
    4 | use std::collections::HashSet;
      |        ^~
main.c:5:1: error: unknown type name 'use'
    5 | use std::collections::VecDeque;
      | ^~~
main.c:5:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '::' token
    5 | use std::collections::VecDeque;
      |        ^~
main.c:6:1: error: unknown type name 'use'
    6 | use std::io::Read;
      | ^~~
main.c:6:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '::' token
    6 | use std::io::Read;
      |        ^~
main.c:7:1: error: unknown type name 'use'
    7 | use std::usize::MAX;
      | ^~~
main.c:7:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '::' token
    7 | use std::usize::MAX;
      |        ^~
main.c:9:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '!' token
    9 | macro_rules! input {(source = $s:expr, $($r:tt)*) => {let mut iter = $s.split_whitespace();let mut next = || { iter.next().unwrap() };input_inner!{next, $($r)*}};($($r:tt)*) => {let stdin = std::io::stdin();let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));let mut next = move || -> String{bytes.by_ref().map(|r|r.unwrap() as char).skip_while(|c|c.is_whitespace()).take_while(|c|!c.is_whitespace()).collect()};input_inner!{next, $($r)*}};}
      |            ^
main.c:10:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '!' token
   10 | macro_rules! input_inner {($next:expr) => {};($next:expr, ) => {};($next:expr, $var:ident : $t:tt $($r:tt)*) => {let $var = read_value!($next, $t);input_inner!{$next $($r)*}};}
      |            ^
main.c:11:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '!' token
   11 | macro_rules! read_value {($next:expr, ( $($t:tt),* )) => {( $(read_value!($next, $t)),* )};($next:expr, [ $t:tt ; $len:expr ]) => {(0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()};($next:expr, chars) => {read_value!($next, String).chars().collect::<Vec<char>>()};($next:expr, usize1) => {read_value!($next, usize) - 1};($next:expr, [ $t:tt ]) => {{let len = read_value!($next, usize);(0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()}};($next:expr, $t:ty) => {$next().parse::<$t>().expect("Parse error")};}
      |            ^
main.c:11:133: error: too many decimal points in number
   11 | macro_rules! read_value {($next:expr, ( $($t:tt),* )) => {( $(read_value!($next, $t)),* )};($next:expr, [ $t:tt ; $len:expr ]) => {(0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()};($next:expr, chars) => {read_value!($next, String).chars().collect::<Vec<char>>()};($next:expr, usize1) => {read_value!($next, usize) - 1};($next:expr, [ $t:tt ]) => {{let len = read_value!($next, usize);(0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()}};($next:expr, $t:ty) => {$next().parse::<$t>().expect("Parse error")};}
      |                                                                                                                                     ^~~~~~~
main.c:11:400: error: too many decimal points in number
   11 | macro_rules! read_value {($next:expr, ( $($t:tt),* )) => {( $(read_value!($next, $t)),* )};($next:expr, [ $t:tt ; $len:expr ]) => {(0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()};($next:expr, chars) => {read_value!($next, String).chars().collect::<Vec<char>>()};($next:expr, usize1) => {read_value!($next, usize) - 1};($next:expr, [ $t:tt ]) => {{let len = read_value!($next, usize);(0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()}};($next:expr, $t:ty) => {$next().parse::<$t>().expect("Parse error")};}
      |                                                                                                                                                                                                                                                                                                                                                                                                                ^~~~~~
main.c:13:1: error: unknown type name 'fn'
   13 | fn solve() {
      | ^~
main.c: In function 'solve':
main.c:14:5: error: 'input' undeclared (first use in this function); did you mean 'int'?
   14 |     input! {
      |     ^~~~~
      |     int
main.c:14:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:10: error: expected ';' before '!' token
   14 |     input! {
      |          ^
      |          ;
main.c:21:9: error: expected '(' before 'i'
   21 |     for i in 0..m {
      |         ^
      |         (
main.c:21:9: error: 'i' undeclared (first use in this function)
main.c:21:14: error: too many decimal points in number
   21 |     for i in 0..m {
      |              ^~~~
main.c: At top level:
main.c:32:1: error: unknown type name 'fn'
   32 | fn main() {
      | ^~
main.c: In function 'main':
main.c:33:5: error: unknown type name 'let'
   33 |     let thd = std::thread::Builder::new().stack_size(104_857_600);
      |     ^~~
main.c:33:15: error: 'std' undeclared (first use in this function)
   33 |     let thd = std::thread::Builder::new().stack_size(104_857_600);
      |               ^~~
main.c:33:18: error: expected ',' or ';' before '::' token
   33 |     let thd = std::thread::Builder::new().stack_size(104_857_600);
      |                  ^~
main.c:33:54: error: invalid suffix "_857_600" on integer constant
   33 |     let thd = std::thread::Builder::new().stack_size(104_857_600);
      |                                                      ^~~~~~~~~~~
main.c:34:8: error: request for member 'spawn' in something not a structure or union
   34 |     thd.spawn(|| solve()).unwrap().join().unwrap();
      |        ^
main.c:34:15: error: expected expression before '||' token
   34 |     thd.spawn(|| solve()).unwrap().join().unwrap();
      |               ^~
main.c: At top level:
main.c:47:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
   47 | const LARGE_PRIME: u64 = 1_000_000_007;
      |                  ^
main.c:47:26: error: invalid suffix "_000_000_007" on integer constant
   47 | const LARGE_PRIME: u64 = 1_000_000_007;
      |                          ^~~~~~~~~~~~~