#include <iostream>
#include <vector>
using namespace std;
int main()
{
int min = 999999;
vector<int> arr;
while (1) {
int temp;
cin >> temp;
if (temp == -1) {
break;
}
else {
arr.push_back(temp);
if (temp < min) {
min = temp;
cout << "k: ";
int k;
cin >> k;
arr[k] = min;
for (int i = 0; i < arr.size(); ++i) {
cout << arr[i] << " ";
#include <iostream>
#include <vector>
using namespace std;
int main()
{
int min = 999999;
vector<int> arr;
while (1) {
int temp;
cin >> temp;
if (temp == -1) {
break;
}
else {
arr.push_back(temp);
}
if (temp < min) {
min = temp;
}
}
cout << "k: ";
int k;
cin >> k;
arr[k] = min;
for (int i = 0; i < arr.size(); ++i) {
cout << arr[i] << " ";
}
}