What is wrong with my references?

Problem Info

Teleport: USACO

My Work

/*
http://www.usaco.org/index.php?page=viewproblem2&cpid=807
there is something wrong with my referencing :( need helpppp )
*/
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;

int main (){
//   freopen("teleport.in", "r", stdin);
//   freopen("teleport.out", "w", stdout);
  int start, end, tel1, tel2;
  cin >> start >> end >> tel1 >> tel2;
  int minDist = abs (end - start);

  if (abs (start - tel1) < abs (start - tel2))    {
      int& closer = tel1;
      int& further = tel2;
      cout<<closer<<" "<<further<<endl;
      
    }
      else {
      int& closer = tel2; 
      int& further = tel1;
          
    }
    
    int maybeOut = abs (start - closer) + abs (end - further);
      if (maybeOut < minDist){
	  cout << maybeOut;
	}
      else	{
	  cout << minDist;
	}
cout<<minDist;

      return 0;
    }

Add explanation of code here:
First it finds the length of the distance without the teleporter, then it compares it with the length when the teleporter is used. Outputs the shorter distance.

What I’ve Tried

google.

Question

I did a little bit of debugging and found that the problem is most likely with my referencing. What did I do wrong?

What do you mean by your referencing?

The referencing cpp function thing
Uses & as an operator thing
Ugh idk what words to use :confused:
Google will explain it better

You shouldn’t need to use any references or anything to solve this problem. I’d honestly recommend rewriting this algorithm.