foo.cpp:1:1: error: 'include' does not name a type
include <iostream> include <cmath> include <stdio.h> include <algorithm>
^
foo.cpp: In function 'int main()':
foo.cpp:17:33: error: 'scanf' was not declared in this scope
while( scanf( "%d %d" , &n , &k ) != EOF )
^
foo.cpp:17:38: error: 'EOF' was not declared in this scope
while( scanf( "%d %d" , &n , &k ) != EOF )
^
foo.cpp:27:25: error: expression cannot be used as a function
ans = ( a[0] ( a[0] - 1 ) / 2 ) % modd;
^
foo.cpp:29:31: error: expression cannot be used as a function
ans = ( ans + a[i] ( a[i] - 1 ) / 2 ) % modd;
^
foo.cpp:30:1: error: 'cout' was not declared in this scope
cout << ans % modd << endl;
^
foo.cpp:30:23: error: 'endl' was not declared in this scope
cout << ans % modd << endl;
^