Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>;
- #include <Algorithms>;
- #include <math>;
- //#include <iomanip> ;
- #include <ifstream>;
- #include <ofstream>;
- using namespace std;
- int main()
- {
- ofstream fo;
- fo.open("output.txt");
- ifstream fi;
- fi.open("input.txt");
- int n, m, b, c, y, x, maxc=-1;
- int a[200000];
- fin>>n>>m;
- for ( i = 1; i < n; i++ )
- {
- fin>>a[i];
- if (a[i] > maxc)
- maxc = a[i];
- }
- for ( i = 1; i < n; i++ )
- {
- if (a[i]>=(maxc-m))then
- fout<<i<<' ';
- }
- fout.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement