ALBANY — For the first time in recent memory, the New York presidential primary is playing a vital role in the race for the White House.

All eyes in the political world are on the Empire State as voters prepare to cast ballots in Tuesday’s Republican and Democratic contests. The five remaining candidates have been barnstorming the state for the past two weeks, hoping to lock up votes in key areas.

Here are five things to watch for on Tuesday:

1. New York competes congressional district by congressional district.

Unlike most other states, New York delegates aren’t doled out strictly in proportion with a candidate’s statewide vote total. Instead, it’s like 27 “mini-primaries” — one for each of the state’s 27 congressional districts. Candidates vie for wins and delegates in each district, rather than a straight-up win or loss on statewide totals.

Three Republican delegates are at stake in each congressional district. If a candidate gets more than 50 percent of the vote in a district, he wins all three. If no one gets 50 percent, the top vote-getter garners two, the runner-up one. There also are 14 at-large delegates. If a candidate tops 50 percent in the statewide total, he or she will get them all.

advertisement | advertise on newsday

Six Democratic delegates are up for grabs in most districts, though some have five or seven.

The Democrats are using a slightly more complicated formula to divvy up delegates. In most districts, these are the key numbers to know: If a candidate gets 58.4 percent of the vote in a district, he/she gets four of the six delegates. If the candidate gets between 41.7 and 58.3 percent, he/she gets three. So in most districts, Sanders, say, could lose 55-45 and still split the six delegates.

2. Can Donald Trump run the table and win all the GOP delegates?

It would be “absolutely stunning” if Trump doesn’t win New York, said Baruch College political scientist David Birdsell. But the key question is can he sweep each district?

His supporters are predicting it. Others aren’t so sure, saying internal projections show at least 15 delegates going to either Ohio Gov. John Kasich or Sen. Ted Cruz (R-Texas).

Here’s why this is important: Trump, though he’s the overall front-runner, likely needs a big win in New York to have a path to winning a majority of delegates before the GOP national convention and avoiding a floor fight in Cleveland.

One Associated Press projection says Trump needs to win at least 77 of the 95 delegates at stake Tuesday to maintain a realistic chance. Others projections vary, but only slightly. Bottom line: Trump needs to run up the score in his home state.

3. Can Hillary Clinton effectively stop Sen. Bernie Sanders in her adopted state?

Clinton leads the Vermont senator by more than 600 delegates, but has lost the last seven contests. So she is looking for a New York win not only to slow Sanders’ run, but also to begin to mathematically put the nomination out of his reach.

Delegate Tracker

Democratic Candidates

Clinton 2,814
Sanders 1,893

2,382 needed for nomination

Republican Candidates

Trump 1,543

1,237 needed for nomination

Clinton has the backing of all of New York’s statewide officials and almost all of the Democrats in the state legislature. And at every campaign stop, she has reminded voters of issues she worked on when serving as a New York senator from 2001-09. A loss here wouldn’t hurt her as much in the delegate count as it would in the public perception of the race.

advertisement | advertise on newsday

4. Where can Kasich and Cruz take delegates?

Despite Trump getting more than 50 percent of GOP voters’ support statewide in most polls, Republican strategists have said the two underdogs have opportunities to peel away some delegates — which could prove important down the line.

Some Republicans say Kasich and Cruz have opportunities to take delegates in each of the New York City boroughs, save for Staten Island. Many are watching Manhattan’s Upper East Side and some say one Bronx district is too tough to call because it has so few enrolled Republicans. Tellingly, Kasich and Cruz campaigned with religious leaders in low-Republican areas of the Bronx and Brooklyn.

They also have opportunities to keep Trump under 50 percent in the Capital Region, the North Country, Central New York and the Finger Lakes. Buffalo is seen as strong Trump territory.

5. Can Sanders pull another surprise in a state that doesn’t allow independent voters to participate in primaries?

advertisement | advertise on newsday

Sanders has kept his campaign going, in part, by coming from behind in some states or posting wins in states that were supposed to be toss-ups. Wisconsin on April 5 was the most recent example.

He is behind at least 10 points in most New York polls. Further, Sanders has performed better in states with “open” primaries, which allow those not registered with a political party, as well as members of minor parties, to vote in them. That’s not the case in New York. It fits the profile of states where Clinton has won: a big state, a closed primary, significant minority population.

Said Birdsell: “There’s less of a prospect of a surprise here because it’s a closed primary.”