foo.cpp:1:1: error: 'include' does not name a type
include<cstdio> include<algorithm>
^
foo.cpp: In function 'int main()':
foo.cpp:5:29: error: 'scanf' was not declared in this scope
scanf("%d%d%d%d",&n,&s,&t,&m);
^
foo.cpp:11:18: error: 'printf' was not declared in this scope
printf("%d\n",ans);
^
foo.cpp:13:15: error: 'sort' was not declared in this scope
sort(a+1,a+1+m);
^
foo.cpp:32:24: error: 'min' was not declared in this scope
for (int j=q;j<=min(i,t);j++)
^
foo.cpp:38:50: error: 'min' was not declared in this scope
for (int i=n+1;i<=n+t+1;i++) ans=min(ans,dp[i%tt]);
^
foo.cpp:39:16: error: 'printf' was not declared in this scope
printf("%d",ans);
^