I've formatted the code to make it more readable



#include <iostream>
using namespace std;

int main()
{
int k,