#include <iostream>
#include <sstream>
#include <unordered_map>
#include <cstdlib>
int main()
{
// read in the values instead of this
const int value_of_credit = 200 ;
const int available[] = { 1, 2, 67, 3, 4, 133, 5, 6, 7, 8, 9 } ;
const std::size_t N = sizeof(available)/sizeof(*available) ;
std::unordered_map<int,int> map ;
for( std::size_t pos = 0 ; pos < N ; ++pos )
{
auto iter = map.find( available[pos] ) ;
if( iter != map.end() )
{
std::cout << iter->second << ' ' << pos << '\n' ;
return EXIT_SUCCESS ;
}
else map[ value_of_credit - available[pos] ] = pos ;
}
// return EXIT_FAILURE ; // no solutio
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3N0cmVhbT4KI2luY2x1ZGUgPHVub3JkZXJlZF9tYXA+CiNpbmNsdWRlIDxjc3RkbGliPgoKaW50IG1haW4oKQp7CiAgICAvLyByZWFkIGluIHRoZSB2YWx1ZXMgaW5zdGVhZCBvZiB0aGlzCiAgICBjb25zdCBpbnQgdmFsdWVfb2ZfY3JlZGl0ID0gMjAwIDsKICAgIGNvbnN0IGludCBhdmFpbGFibGVbXSA9IHsgMSwgMiwgNjcsIDMsIDQsIDEzMywgNSwgNiwgNywgOCwgOSB9IDsKICAgIGNvbnN0IHN0ZDo6c2l6ZV90IE4gPSBzaXplb2YoYXZhaWxhYmxlKS9zaXplb2YoKmF2YWlsYWJsZSkgOwoKICAgIHN0ZDo6dW5vcmRlcmVkX21hcDxpbnQsaW50PiBtYXAgOwogICAgZm9yKCBzdGQ6OnNpemVfdCBwb3MgPSAwIDsgcG9zIDwgTiA7ICsrcG9zICkKICAgIHsKICAgICAgICBhdXRvIGl0ZXIgPSBtYXAuZmluZCggYXZhaWxhYmxlW3Bvc10gKSA7CiAgICAgICAgaWYoIGl0ZXIgIT0gbWFwLmVuZCgpICkKICAgICAgICB7CiAgICAgICAgICAgIHN0ZDo6Y291dCA8PCBpdGVyLT5zZWNvbmQgPDwgJyAnIDw8IHBvcyA8PCAnXG4nIDsKICAgICAgICAgICAgcmV0dXJuIEVYSVRfU1VDQ0VTUyA7CiAgICAgICAgfQogICAgICAgIGVsc2UgbWFwWyB2YWx1ZV9vZl9jcmVkaXQgLSBhdmFpbGFibGVbcG9zXSBdID0gcG9zIDsKICAgIH0KICAgIC8vIHJldHVybiBFWElUX0ZBSUxVUkUgOyAvLyBubyBzb2x1dGlvCn0K