jiahuimbzuai/CoQuIR huggingface dataset:
//  [swift]
import Foundation

#if swift(>=4.0)
extension String {
    func split(by separator: String) -> [String] {
        return self.components(separatedBy: separator)
    }
    func toArray() -> [String] {
        return self.map{String($0)}
    }
}
#else
extension String {
    func split(by separator: String) -> [String] {
        return self.componentsSeparatedByString(separator)
    }
    func count() -> Int {
        return self.characters.count
    }
    func toArray() -> [String] {
        return self.characters.map{String($0)}
    }
}
extension Array where Element: Comparable {
    func max() -> Element! {
        return self.maxElement()
    }
    func min() -> Element! {
        return self.minElement()
    }
    func sorted() -> Array {
        return self.sort()
    }
    func reversed() -> Array {
        return self.reverse()
    }
    mutating func sort() {
        self.sortInPlace()
    }
}
extension Array {
    init(repeating: Element, count: Int) {
        self.init(count: count, repeatedValue: repeating)
    }
}
func stride<T: Strideable>(from start: T, to end: T, by stride: T.Stride) -> StrideTo<T> {
    return start.stride(to: end, by: stride)
}
#endif
func readInt() -> Int? {
    return Int(readLine()!)
}
func readStringSplit(by separator: String) -> [String] {
    return readLine()!.split(by: separator)
}
func readIntSplit(by separator: String) -> [Int] {
    return readLine()!.split(by: separator).map{Int($0)!}
}
func pow(_ lhs: Int, _ rhs: Int) -> Int {
    return (0..<rhs).reduce(1){(i,_) in i * lhs}
}

/*************** テストスペース ***************/



/*************** メインプログラム ***************/

let input = readIntSplit(by: " ")
let (x1, y1, x2, y2) = (input[0], input[1], input[2], input[3])
let (dx, dy) = (x1-x2, y1-y2)
let (x3, y3) = (x2+dy, y2-dx)
let (x4, y4) = (x3+dx, y3+dy)
print("\(x3) \(y3) \(x4) \(y4)")
//  [swift]
import Foundation

#if swift(>=4.0)
extension String {
    func split(by separator: String) -> [String] {
        return self.components(separatedBy: separator)
    }
    func toArray() -> [String] {
        return self.map{String($0)}
    }
}
#else
extension String {
    func split(by separator: String) -> [String] {
        return self.componentsSeparatedByString(separator)
    }
    func count() -> Int {
        return self.characters.count
    }
    func toArray() -> [String] {
        return self.characters.map{String($0)}
    }
}
extension Array where Element: Comparable {
    func max() -> Element! {
        return self.maxElement()
    }
    func min() -> Element! {
        return self.minElement()
    }
    func sorted() -> Array {
        return self.sort()
    }
    func reversed() -> Array {
        return self.reverse()
    }
    mutating func sort() {
        self.sortInPlace()
    }
}
extension Array {
    init(repeating: Element, count: Int) {
        self.init(count: count, repeatedValue: repeating)
    }
}
func stride<T: Strideable>(from start: T, to end: T, by stride: T.Stride) -> StrideTo<T> {
    return start.stride(to: end, by: stride)
}
#endif
func readInt() -> Int? {
    return Int(readLine()!)
}
func readStringSplit(by separator: String) -> [String] {
    return readLine()!.split(by: separator)
}
func readIntSplit(by separator: String) -> [Int] {
    return readLine()!.split(by: separator).map{Int($0)!}
}
func pow(_ lhs: Int, _ rhs: Int) -> Int {
    return (0..<rhs).reduce(1){(i,_) in i * lhs}
}

/*************** テストスペース ***************/



/*************** メインプログラム ***************/

let input = readIntSplit(by: " ")
let (x1, y1, x2, y2) = (input[0], input[1], input[2], input[3])
let (dx, dy) = (x1-x2, y1-y2)
let (x3, y3) = (x2-dy, y2+dx)
let (x4, y4) = (x3-dx, y3-dy)
print("\(x3) \(y3) \(x4) \(y4)")
//  [typescript]
const input=require('fs').readFileSync('/dev/stdin','utf8').split(/[\s]/);const tn=():number=>{const a=input[0];input.shift();return Number(a)};const tnn=(n:number):number[]=>{const a=[];for(let i=0;i<n;i++){a.push(tn())}return a};const ts=():string=>{const a=input[0];input.shift();return String(a)};const tss=(n:number):string[]=>{const a=[];for(let i=0;i<n;i++){a.push(ts())}return a};const tc=():string=>{let a=input[0].split('');const b=a[0];a.shift();if(a.length>0){input[0]=a.join('')}else{input.shift()}return String(b)};const tcc=(n:number):string[]=>{const a=[];for(let i=0;i<n;i++){a.push(tc())}return a};const to=(...arg)=>{console.log(...arg)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const floor=(a)=>{return Math.floor(a)};const asc=(ar:number[])=>{return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{return ar.sort((a,b)=>{return b-a})};const sw=(a,arr:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<arr.length-1;i+=2){if(eval(a+op+arr[i])){return arr[i+1];}}return arr[arr.length-1]};const near=(n:number,arr:number[]):number=>{let ne=arr[0],ni=0;for(let i=1;i<arr.length;i++){if(Math.abs(n-ne)>Math.abs(n-arr[i])){ne=arr[i];ni=i}}return ni};const objvs =(a)=>{const b=[];for(const v in a){b.push(a[v])}return b};
const main=()=>{
  let [a,b,c,d]=tnn(4)
  let x=c-a
  let y=d-b
  to((c-y)+' '+(d+x)+' '+(a-y)+' '+(b+x))

}
main()
//  [typescript]
function main(input) {
  input = input.trim();
  const [x1, y1, x2, y2] = input.split(" ").map(a => Number(a));
  const x3 = x2 - y2 + y1;
  const y3 = y2 + x2 - x1;
  const x4 = x3 - x2 + x1;
  const y4 = y3 - y2 + y1;
  console.log([x3, y3, x4, y4].join(" "));
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [typescript]
const stdin = require('fs').readFileSync('/dev/stdin', 'utf8')

const [x1, y1, x2, y2] = stdin
  .split('\n')[0]
  .split(' ')
  .map(Number)

const x3 = x2 - (y2 - y1)
const y3 = y2 + (x2 - x1)

const x4 = x1 - (y2 - y1)
const y4 = y1 + (x2 - x1)

console.log(x3, y3, x4, y4)
//  [typescript]
function main(input) {
const x1 = input.split(/\s|\n/g)[0],
	  y1 = input.split(/\s|\n/g)[1],
	  x2 = input.split(/\s|\n/g)[2],
	  y2 = input.split(/\s|\n/g)[3],
      x3 = x2-(y2-y1),
      y3 = y2+(x2-x1);
console.log(`${x3} ${y3} ${x3-(y3-y2)} ${y3+(x3-x2)}`)
  
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [python]
a, b = map(int, input().split())
t = 0
for i in range(b-a):
    t += i+1
print(t-b)
//  [python]
a,b = map(int, input().split())
c = b-a
cnt = 0
for i in range(c):
    cnt += i
print(cnt-a)
//  [python]
x,y=map(int,input().split())
tmp = (y-x)
print(((tmp+1)*tmp)//2 - y)
//  [python]
lst = input().split()
a = int(lst[0])
b = int(lst[1])

def height(n):
   return sum(range(1, n + 1))

poles = []
for i in range(1, 1000):
   poles.append(height(i))

for i in range(1, 499500):
   for j in range(997):
      if ((a + i) == poles[j]) and ((b + i) == poles[j + 1]):
         print(i)
         exit()
//  [python]

[a,b] = list(map(int,input().split()))

tou = []
dam=0
for i in range(1,1000):
    dam +=i
    tou.append(dam)
# print(tou[-1])

for ans in range(1,5000000):
    west, east = a+ans, b+ans
    for j in range(998):
        if west==tou[j] and east==tou[j+1]:
            # print("west,wast,j,ans", west,east,j,ans)
            out=ans
            break
print(out)
//  [python]

[a,b] = list(map(int,input().split()))

tou = []
dam=0
for i in range(1,1000):
    dam +=i
    tou.append(dam)

for ans in range(1,10000):
    west, east = a+ans, b+ans
    for j in range(998):
        if west==tou[j] and east==tou[j+1]:
            # print("west,wast,j,ans", west,east,j,ans)
            out=ans
            break
print(out)
//  [java]
import java.io.*;
import java.util.*;
class Main{
	static final long MOD = 1_000_000_007; // 10^9+7
    static final int MAX = 2_147_483_646; // intMax 
    static final int INF = 1_000_000_000; // 10^9  
    public static void main(String[] args) throws Exception {
		hayami saori = new hayami();
		int a = saori.saori_hayami();
		int b = saori.saori_hayami();
		int n = b - a;
		int num = 0;
		for(int i = 1;i < n;i++){
			num += i;
		}
		System.out.println(num-a);
		saori.close();
    }
}

class hayami implements Closeable {
	private final InputStream in = System.in;
	private final byte[] hayami = new byte[1024];
	private int Hayami = 0;
	private int saori = 0;
	private boolean HayamiSaori() {
		if (Hayami < saori) {
			return true;
		}else{
			Hayami = 0;
			try {
				saori = in.read(hayami);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (saori <= 0) {
				return false;
			}
		}
		return true;
	}
	private int SaoriHayami() { 
		if (HayamiSaori()) {
            return hayami[Hayami++];
         }else{
             return -1;
         }
	}
	private static boolean hayami_saori(int hayami) { 
		return 33 <= hayami && hayami <= 126;
	}
	public boolean hayamisaori() { 
		while(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();
	}
	public String nextHayami() {
		if (!hayamisaori()) throw new NoSuchElementException();
		StringBuilder hayamin = new StringBuilder();
		int saori = SaoriHayami();
		while(hayami_saori(saori)) {
			hayamin.appendCodePoint(saori);
			saori = SaoriHayami();
		}
		return hayamin.toString();
	}
	public long saorihayami() {//nextLong
		if (!hayamisaori()) throw new NoSuchElementException();
		long hayami = 0;
		boolean misao = false;
		int saori = SaoriHayami();
		if (saori == '-') {
			misao = true;
			saori = SaoriHayami();
		}
		if (saori < '0' || '9' < saori) {
			throw new NumberFormatException();
		}
		while(true){
			if ('0' <= saori && saori <= '9') {
				hayami *= 10;
				hayami += saori - '0';
			}else if(saori == -1 || !hayami_saori(saori)){
				return misao ? -hayami : hayami;
			}else{
				throw new NumberFormatException();
			}
			saori = SaoriHayami();
		}
	}
	public int saori_hayami() {//nextInt
		long hayami = saorihayami();
		if (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();
		return (int) hayami;
	}
	public double Hayamin() { //nextDouble
		return Double.parseDouble(nextHayami());
	}
	public void close() {
		try {
			in.close();
		} catch (IOException e) {
		}
    }
    
}
//  [java]
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int sum = 0;
        int aa = 0;
        for (int i = 1; ; i++) {
            sum += i;
            if(sum >= a) {
                aa = sum - a;
                break;
            }
        }
        sum = 0;
        int bb = 0;
        for (int i = 1; ; i++) {
            sum += i;
            if(sum >= b) {
                bb = sum - b;
                break;
            }
        }
        if(aa == bb) {
            System.out.println(aa);
        } else {
            System.out.println(bb);
        }
    }
}
//  [java]
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        //System.out.println((b - a) * (b - a + 1) / 2 - b);
        long sum = 0;
        for (long i = 1; ; i++) {
            sum += i;
            if(sum >= a) {
                break;
            }
        }
        System.out.println(sum -a);
    }
}
//  [java]
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        //System.out.println((b - a) * (b - a + 1) / 2 - b);
        long sum = 0;
        for (long i = 1; ; i++) {
            sum += i;
            if(sum > a) {
                break;
            }
        }
        System.out.println(sum -a);
    }
}
//  [cpp]
#include <cstdio>

int main() {
  int a, b;
  scanf("%d %d", &a, &b);

  int d=b-a;
  printf("%d\n", d*(d-1)/2-a);
}
//  [cpp]
#include <iostream>

using namespace std;

int main() {
    int a, b;
    cin >> a >> b;
    cout << ((b - a) * (b - a - 1) / 2 - a) << endl;
    return 0;
}
//  [cpp]
#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
	int a,b;
	cin>>a>>b;
	int cover=1;
	int start= sqrt(a);
	int end=sqrt(b)+2;
	for(int i=start-1; i<end; i++ ){
		if(((i)*(i+1)/2)>=a and (i)*(i+1)/2 <=b)cover++;
	}
	cout<<cover;
	
}
//  [cpp]
#include<iostream>
using namespace std;
int main (void)
{
  long long int a[2000000],b[2000000],k,sum1=0,sum2=0;
  int n,m,i,j,ans=0;
  
  cin>>n>>m>>k;
  for(i=0;i<n;i++){cin>>a[i];}
  for(i=0;i<m;i++){cin>>b[i];sum2+=b[i];}
  j=m-1;
 
  for(i=0;i<n;i++)
  {
    sum1+=a[i];
    while(sum1+sum2>k)
    {
      sum2=sum2-b[j];
      j--;
    }
    if(i+j+2>ans){ans=i+j+2;}
  }
  cout<<ans<<endl;
  return 0;
}
//  [cpp]
#include <bits/stdc++.h>

using namespace std;

#define IO ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll long long int
#define ull unsigned long long int

const int INF = 1e9 + 7;
const int N = 1e5+5;

int main() {

	IO;

	int n, m;
	cin >> n >> m;
	
	int sum = 1, i = 2;
	
	while (n > sum) {
		sum += i;
		++i;
	}
	
	cout << sum - n;
}
//  [c]
#include <stdio.h>

int main(void){
	int a,b;
	scanf("%d",&a);
	scanf("%d",&b);
	int x = b-a;
	int ans=0;
	int i;
	for(i=1;i<=x;i++){
		ans+=i;
	}
	ans -= b;
	printf("%d",ans);
	
	return 0;}
//  [c]
main(a,b){scanf("%d%d",&a,&b);printf("%d",((b-a)*(b-a)-b-a)/2);}
//  [c]
#include <stdio.h>
int main(){
	int a,b,x,tall=0;
	scanf("%d %d",&a,&b);
	x = b-a;
	for(int i=0;i<x;i++){
		tall += i+1;
	}
	printf("%d",tall-b);
	return 0;
}
//  [c]
# include < cstdio >
typedef long long ll ;
int A , B ;
int main ()
{
scanf ("% d % d " ,&A ,& B );
printf ("% d \ n " ,(B - A )*( B - A +1)/2 - B );
//  [c]
#include <stdio.h>
int main(void){
    int ans = 0;
    long long a;
    long long b;
    
    scanf("%lld %lld", &a, &b);
    ans = ans * (ans + 1) / 2 - b;
    
    printf("%d\n", ans);
}
//  [javascript]
function StoneMonument(input) {
    input = input.split("\n");
    tmp = input[0].split(" ");
    var a = parseInt(tmp[0], 10);
    var b = parseInt(tmp[1], 10);
    console.log((b-a)*(b-a+1)/2-b);
}
StoneMonument(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
var input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
var obj = {
  "list" : input,
  "index" : 0,
  "max" : input.length,
  "next" : function(){
    if(!this.hasNext()){throw "NoSuchElementException:次に要素は無いよ";}
    var returnObj = this.list[this.index];
    this.index++;
    return returnObj;
  },
  "hasNext" : function(){return (this.index < this.max);}
}
Main();
function next(){return obj.next();}
function nextInt(){return myconv(next(),1);}
function nextStrArray(){return myconv(next(),2);}//半角スペース分割
function nextIntArray(){return myconv(next(),4);}//半角スペース + 数値化
function nextCharArray(){return myconv(next(),6);}//1文字分割
function hasNext(){return obj.hasNext();}
function myout(t){console.log(t);}//標準出力
function myerr(t){console.error(t);}//標準エラー出力
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す　1:数値へ変換
//2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字で分割  7:1文字で分割し、数値配列へ
//8:半角SPで結合 9:改行で結合 0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}
function Main(){
  var one = nextIntArray();
  var a = one[0];
  var b = one[1];
  //b - aを行うことで、aの塔の雪なしでの高さがわかる
  var tmp = b - a - 1;
  var A = (tmp * (tmp + 1)) / 2;
  myout(A - a);
}
//  [javascript]
function Main(input) {
  input = input.split(" ");
  var a = parseInt(input[0]);
  var b = parseInt(input[1]);

  var num = b - a;
  var result = 0;
  function treeHeight(number) {
    for (var i = 1; i <= number; i++) {
      result += i;
    }
    return result;
  }

  var treeB = treeHeight(num);
  console.log(treeB - b);
}


Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
"use strict";
const Main = (input) =>{
   let xs = input.trim().split(' ').map(v=>parseInt(v,10));
　 let a = 0;
   let b = 0;
   
   for(let i=1; i<xs[0]; i++){
      if(a<=xs[0]){
      a += i;
      }else{
      break;
      }
   }
   for(let i=1; i<xs[1]; i++){
      if(b<=xs[1]){
      b += i;
      }else{
      break;
      }
   }
   let ans = a+b;
   let ans1 = xs[0]+xs[1]
   console.log((ans-ans1)/2);
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));
//  [javascript]
"use strict";
const Main = (input) =>{
   let xs = input.trim().split(' ').map(v=>parseInt(v,10));
　 let a = 0;
   let b = 0;
   
   for(let i=1; i<xs[0]; i++){
      if(a<xs[0]){
      a += i;
      }else{
      break;
      }
   }
   for(let i=1; i<xs[1]; i++){
      if(b<xs[1]){
      b += i;
      }else{
      break;
      }
   }
   let ans = a+b;
   let ans1 = xs[0]+xs[1]
   console.log((ans-ans1)/2);
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));
//  [javascript]
"use strict";
const Main = (input) =>{
   let xs = input.trim().split(' ').map(v=>parseInt(v,10));
　 let a = 0;
   let b = 0;
   
   for(let i=1; i<xs[0]; i++){
      if(a<xs[0]){
      a += i;
      }else{
      break;
      }
   }
   for(let i=1; i<xs[1]; i++){
      if(b<xs[1]){
      b += i;
      }else{
      break;
      }
   }
   let ans = b+a;
   let ans1 = xs[0]+xs[1]
   console.log((ans-ans1)/2);
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));
//  [go]
package main

import "fmt"

func main() {
	var a, b int
	fmt.Scan(&a, &b)
	tmp := b - a
	west := 0
	for i := 1; i < tmp; i++ {
		west += i
	}
	fmt.Println(west - a)
}
//  [go]
package main

import "fmt"

func main() {
	var a, b int
	fmt.Scan(&a, &b)
	diff := b - a
	west := 0
	// 結局これは等差数列の和
	for i := 1; i < diff; i++ {
		west += i
	}
	fmt.Println(west - a)
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var a,b int
	fmt.Scan(&a,&b)
	
	diff := b - a
	east := 0
	for i := 1; i < diff; i++ {
		east += i
	}
	fmt.Println(east - a)
}
//  [go]
package main

import "fmt"

func main() {
	var a, b int
	fmt.Scan(&a, &b)

	curNum := 1
	numMap := map[int]bool{curNum: true}
	for i := 2; i <= 999; i++ {
		curNum += i
		numMap[curNum] = true
	}

	for i := 1; i < 10000000000; i++ {
		if numMap[a+i] && numMap[b+i] {
			fmt.Println(i)
			return
		}
	}
}
//  [go]
package main

import "fmt"

func main() {
	var a, b int
	fmt.Scan(&a, &b)

	curNum := 1
	numMap := map[int]bool{curNum: true}
	for i := 2; i <= 999; i++ {
		curNum += i
		numMap[curNum] = true
	}

	for i := 1; i < 1000000000; i++ {
		if numMap[a+i] && numMap[b+i] {
			fmt.Println(i)
			return
		}
	}
}
//  [go]
package main

import "fmt"

func main() {
	var a, b int
	fmt.Scan(&a, &b)

	curNum := 1
	numMap := map[int]bool{curNum: true}
	for i := 2; i < 999; i++ {
		curNum += i
		numMap[curNum] = true
	}

	for i := 1; i < 1000000000; i++ {
		if numMap[a+i] && numMap[b+i] {
			fmt.Println(i)
			return
		}
	}
}
//  [ruby]
a, b = gets.chomp.split.map(&:to_i)
puts (b - a) *  (b - a + 1) / 2 - b
//  [ruby]
# abc099 B
a, b = gets.split.map(&:to_i)

tou = [1]

(2).upto(999) do |i|
  tou[i-1] = tou[i-2] + i
end
tou.each_cons(2) do |x,y|
  if y-x == b-a
    p x - a
    exit
  end
end
//  [ruby]
a,b = gets.chomp.split.map(&:to_i)

# 元の柱の長さを出す
n = b - a

west = 0
n.times do |i|
  west += i
end

# こたえ
puts west - a
//  [ruby]
ab = gets.chomp.split
a = ab[0].to_i
b = ab[1].to_i

diff = b - a
puts diff - (b % diff)
//  [ruby]
ab = gets.chomp.split
a = ab[0].to_i
b = ab[1].to_i

diff = b - a
puts diff - (a % diff)
//  [ruby]
ab = gets.chomp.split
a = ab[0].to_i
b = ab[1].to_i

if (a - b).abs == 1
    puts 1
else
    i = 2
    loop do
        break if a % i == b % i
        i += 1
    end
    puts i - (a % i)
end
//  [rust]
use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let a: usize = read();
    let b: usize = read();
    let mut x: Vec<i64> = vec![];
    let mut tmp: i64 = 0;

    for i in 0..1000 {
        tmp += i;
        x.push(tmp);
    }
    // println!("{:?}", x);

    println!("{}", x[b - a] - b as i64);
}
//  [rust]
#![allow(unused)]

//入力マクロここから
//https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules ! input_inner { ( $ next : expr ) => { } ; ( $ next : expr , ) => { } ; ( $ next : expr , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; }
macro_rules ! read_value { ( $ next : expr , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ next , $ t ) ) ,* ) } ; ( $ next : expr , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ next , $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ next : expr , chars ) => { read_value ! ( $ next , String ) . chars ( ) . collect ::< Vec < char >> ( ) } ; ( $ next : expr , usize1 ) => { read_value ! ( $ next , usize ) - 1 } ; ( $ next : expr , $ t : ty ) => { $ next ( ) . parse ::<$ t > ( ) . expect ( "Parse error" ) } ; }
macro_rules ! input { ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut iter = $ s . split_whitespace ( ) ; let mut next = || { iter . next ( ) . unwrap ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; ( $ ( $ r : tt ) * ) => { let stdin = std :: io :: stdin ( ) ; let mut bytes = std :: io :: Read :: bytes ( std :: io :: BufReader :: new ( stdin . lock ( ) ) ) ; let mut next = move || -> String { bytes . by_ref ( ) . map ( | r | r . unwrap ( ) as char ) . skip_while ( | c | c . is_whitespace ( ) ) . take_while ( | c |! c . is_whitespace ( ) ) . collect ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; }
//入力マクロここまで

//input
//use std::io::Read;

//collections
//use std::collections::BTreeMap;
//use std::collections::BTreeSet;
//use std::collections::HashMap;
//use std::collections::HashSet;

fn main() {
    input! {
        a: usize,
        b: usize,
    }

    let mut ans = 0;

    for i in 1..b - a  {
        ans += i;
    }

    ans -= a;

    println!("{}", ans);
}
//  [rust]
#[macro_use]
pub mod basic_stdin {
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    use std::io::stdin;
    use std::io::Read;

    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed reading char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed parsing")
}

}

#[macro_export]
macro_rules! test_function {
    (func = $func:expr, $($input:expr => $output:expr),* $(,)*) => {
        $(
            assert_eq!($func(std::io::Cursor::new($input)) , $output);
        )*
    };
}

#[macro_export]
macro_rules! input_macro {
    (string = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    (reader = $s:expr, $($r:tt)*) => {
        let reader = std::io::BufReader::new($s);
        let mut bytes = std::io::Read::bytes(reader);
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[macro_export]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
    ($iter:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

#[macro_export]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    let stdin = std::io::stdin();
    let ret = solve(stdin.lock());

    println!("{}", ret);
}

fn solve<T: std::io::Read>(reader: T) -> u64 {
    input_macro! {
        reader = reader,
        a: u64,
        b: u64,
    }

    let n = b - a - 1;

    n * (n + 1) / 2 - a
}

#[cfg(test)]
mod tests {

    #[test]
    fn test_solve_function() {
        atcorder::test_function! {
            func = super::solve,
            "8 13" => 2,
            "1 6" => 9,
            "54 65" => 1,
        }
    }
}
//  [rust]
use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let a: usize = read();
    let b: usize = read();
    let mut x: Vec<i64> = vec![];
    let mut tmp: i64 = 0;

    for i in 0..999 {
        tmp += i;
        x.push(tmp);
    }
    // println!("{:?}", x);

    println!("{}", x[b - a] - b as i64);
}
//  [rust]
#[macro_use]
pub mod basic_stdin {
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    use std::io::stdin;
    use std::io::Read;

    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed reading char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed parsing")
}

}

#[macro_export]
macro_rules! test_function {
    (func = $func:expr, $($input:expr => $output:expr),* $(,)*) => {
        $(
            assert_eq!($func(std::io::Cursor::new($input)) , $output);
        )*
    };
}

#[macro_export]
macro_rules! input_macro {
    (string = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    (reader = $s:expr, $($r:tt)*) => {
        let reader = std::io::BufReader::new($s);
        let mut bytes = std::io::Read::bytes(reader);
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[macro_export]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
    ($iter:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

#[macro_export]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    let stdin = std::io::stdin();
    let ret = solve(stdin.lock());

    println!("{}", ret);
}

fn solve<T: std::io::Read>(reader: T) -> u64 {
    input_macro! {
        reader = reader,
        a: u64,
        b: u64,
    }

    let n = b - a - 1;
    dbg!(n);

    n * (n + 1) / 2 - a + 1
}

#[cfg(test)]
mod tests {

    #[test]
    fn test_solve_function() {
        atcorder::test_function! {
            func = super::solve,
            "8 13" => 2,
            "1 6" => 9,
            "54 65" => 1,
        }
    }
}
//  [rust]
#[macro_use]
pub mod basic_stdin {
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    use std::io::stdin;
    use std::io::Read;

    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed reading char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed parsing")
}

}

#[macro_export]
macro_rules! test_function {
    (func = $func:expr, $($input:expr => $output:expr),* $(,)*) => {
        $(
            assert_eq!($func(std::io::Cursor::new($input)) , $output);
        )*
    };
}

#[macro_export]
macro_rules! input_macro {
    (string = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    (reader = $s:expr, $($r:tt)*) => {
        let reader = std::io::BufReader::new($s);
        let mut bytes = std::io::Read::bytes(reader);
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[macro_export]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
    ($iter:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

#[macro_export]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    let stdin = std::io::stdin();
    let ret = solve(stdin.lock());

    println!("{}", ret);
}

fn solve<T: std::io::Read>(reader: T) -> u64 {
    input_macro! {
        reader = reader,
        _a: u64,
        b: u64,
    }

    let mut sum: u64 = 0;
    for i in 1..100 {
        sum += i;
        if sum >= b {
            return sum - b;
        }
    }

    assert!(false);

    0
}

#[cfg(test)]
mod tests {

    #[test]
    fn test_solve_function() {
        atcorder::test_function! {
            func = super::solve,
            "8 13" => 2,
            "54 65" => 1,
        }
    }
}
//  [swift]
let i=readLine()!.characters.split(" ").map{Int(String($0))!};print((1..<i[1]-i[0]).reduce(0){$0+$1}-i[0])
//  [swift]
let i=readLine()!.characters.split(" ").map{Int(String($0))!};print((1..<i[1]-i[0]).reduce(-i[0]){$0+$1})
//  [swift]
import Foundation
func toTuple<T>(_ args: [T]) -> (T, T) { (args[0], args[1]) }
func readInts() -> [Int] { readLine()!.split(separator: " ").map { Int($0)! } }

let (a, b) = toTuple(readInts())
let n = b - a - 1
print(n * (n + 1) / 2 - a)
//  [swift]
let i=readLine()!.characters.split(" ").map{Int(String($0))!},a=i[0],b=[1];print((1..<b-a).reduce(0){$0+$1}-a)
//  [typescript]
const stdin = require('fs').readFileSync('/dev/stdin', 'utf8')

const [a,b] = stdin.split('\n')[0].split(' ').map(Number)

const diff = b - a

let tower = 0
let towers = []
for (let i = 1; i <= 999; i++) {
  tower += i

  towers.push(tower)
}

let res = 0
towers.forEach((e, i) => {
  if(i > 0){
    if(e - towers[i-1] === diff){
      res = e - b
    }
  }
})

console.log(res)
//  [typescript]
const input=require('fs').readFileSync('/dev/stdin','utf8').split(/[\s]/);const tn=():number=>{const a=input[0];input.shift();return Number(a)};const tnn=(n:number):number[]=>{const a=[];for(let i=0;i<n;i++){a.push(tn())}return a};const ts=():string=>{const a=input[0];input.shift();return String(a)};const tss=(n:number):string[]=>{const a=[];for(let i=0;i<n;i++){a.push(ts())}return a};const tc=():string=>{let a=input[0].split('');const b=a[0];a.shift();if(a.length>0){input[0]=a.join('')}else{input.shift()}return String(b)};const tcc=(n:number):string[]=>{const a=[];for(let i=0;i<n;i++){a.push(tc())}return a};const to=(...arg)=>{console.log(...arg)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const floor=(a)=>{return Math.floor(a)};const asc=(ar:number[])=>{return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{return ar.sort((a,b)=>{return b-a})};const sw=(a,arr:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<arr.length;i+=2){if(eval(a+op+arr[i]))return arr[i+1];}return arr[arr.length-1]};const near=(n:number,arr:number[]):number=>{let ne=arr[0],ni=0;for(let i=1;i<arr.length;i++){if(Math.abs(n-ne)>Math.abs(n-arr[i])){ne=arr[i];ni=i}}return ni};
const main=()=>{
  let [a,b]=tnn(2)
  let n=b-a
  to(n*(n+1)/2-b)
}
main()
//  [typescript]
const Main = (input: string): void => {
	const [a, b] = input.split(" ")
	const numA = parseInt(a)
	const numB = parseInt(b)
	const diff = numB - numA
	let sum = 0;
	for (let i = 1; i <= diff; i++) {
		sum += i
	}
	console.log(sum - numB)
}

 Main(require("fs").readFileSync("/dev/stdin", "utf8"))
//  [typescript]
import * as fs from 'fs';

namespace AtCoder.abc099 {

    export class Program {

        constructor(private readonly args: string[][]) {
        }

        /**
         * in
         *
         * out
         *
         */
        main(this: Program): void {
            const a: number = parseInt(this.args[0][0], 10);
            const b: number = parseInt(this.args[0][1], 10);

            let working: boolean = true;
            let ans: number = 0;

            while (working) {
                let sum: number = 0;
                ans++;
                for (let i: number = 1; i < a; i++) {
                    sum += i;
                    if (a + ans === sum && b + ans === sum + i + 1) {
                        working = false;
                        break;
                    }

                    if (sum>a) {
                        break;
                    }
                }
            }

            console.log(ans);
        }
    }
}

const args: string[][] = fs.readFileSync('/dev/stdin', 'utf8').trim().split('\n').map(r => r.split(' '));
const prg: AtCoder.abc099.Program = new AtCoder.abc099.Program(args);
prg.main();
//  [typescript]
import * as fs from 'fs';

namespace AtCoder.abc099 {

    export class Program {

        constructor(private readonly args: string[][]) {
        }

        /**
         * in
         *
         * out
         *
         */
        main(this: Program): void {
            const a: number = parseInt(this.args[0][0], 10);
            const b: number = parseInt(this.args[0][1], 10);

            let working: boolean = true;
            let ans: number = 0;

            while (working) {
                let sum: number = 0;
                ans++;
                for (let i: number = 1; i < a; i++) {
                    sum += i;
                    if (a + ans === sum && b + ans === sum + i + 1) {
                        working = false;
                        break;
                    }
                }
            }

            console.log(ans);
        }
    }
}

const args: string[][] = fs.readFileSync('/dev/stdin', 'utf8').trim().split('\n').map(r => r.split(' '));
const prg: AtCoder.abc099.Program = new AtCoder.abc099.Program(args);
prg.main();
//  [typescript]
import * as fs from 'fs';

const input = (fs.readFileSync('/dev/stdin', 'utf8') as string).split('\n');

const [a, b] = input[0].split(' ').map((x) => +x);

let sum = 0;
for (let i = 1; i < 1000; i++) {
  sum += i;
  if (a <= sum) {
    for (let j = 1; j < b - a; j++) {
      if (sum === a + j) {
        console.log(j);
        break;
      }
    }
    break;
  }
}
//  [python]
# -*- coding: utf-8 -*-

N = int(input())

ans = int(N ** 0.5) ** 2
print(ans)
//  [python]
N = int(input())
c = 1
for i in reversed(range(int(N**(1/2))+1)):
    if i**2 <= N:
        c = i**2
        break
    break

print(c)
//  [python]
X = int(input())
print(int((X**.5))**2)
//  [python]
import math
x=int(input())
y= math.sqrt(x)
z= y//1
print(int(z))
//  [python]
import math
x=int(input())
y= math.sqrt(x)
z= y//1
print(int(z)
//  [python]
x=input()
float(y)= sqrt(x)
z= y//1
print(z)
//  [java]
import java.util.*;
import java.io.*;

public class Main {
    BufferedReader br;
    PrintWriter out;
    StringTokenizer stok;

    String nextToken() throws IOException {
        while (stok == null || !stok.hasMoreTokens()) {
            String s = br.readLine();
            if (s == null) {
                return null;
            }
            stok = new StringTokenizer(s);
        }
        return stok.nextToken();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    char nextChar() throws IOException {
        return (char) (br.read());
    }

    String nextLine() throws IOException {
        return br.readLine();
    }

    void solve() throws IOException {
        long n = nextInt();
        long x = 1;
        while (x * x <= n) {
            x++;
        }
        x--;
        out.println(x * x);
    }

    void run() throws IOException {
        // br = new BufferedReader(new FileReader("dragons.in"));
        //out = new PrintWriter("dragons.out");
        // br = new BufferedReader(new FileReader("input.txt"));
        // out = new PrintWriter("output.txt");
        br = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        solve();
        br.close();
        out.close();
    }

    public static void main(String[] args) throws IOException {
        // Locale.setDefault(Locale.US);
        new Main().run();
    }
}
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class Main {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str1 = br.readLine();
		int n = Integer.parseInt(str1);
		
		System.out.println((int)Math.pow((int)Math.sqrt(n), 2));
	}

}
//  [java]
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String a = sc.next();
		String b = new StringBuffer(sc.next()).reverse().toString();

		System.out.println(a.equals(b) ? "YES" : "NO");

		sc.close();

	}

}
//  [java]
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long ans = 0;
		
		for(int i=0; Math.pow(i,2)<n; i++){
		    ans = (long)Math.pow(i,2);
		}
		
      	System.out.println(ans);
    }
}
//  [java]
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      	//数値の入力
		long n = sc.nextLong();
      	long count = 0;
      	
        for(int i = 1; i < n; i++){
        	if(i*i<=n){
              count++;
            }
        }
              System.out.println(count*count);
     }
}
//  [cpp]
#include<stdio.h>
#pragma warning (disable:4996)
int main()
{
	int a,i,b;
	while (scanf("%d",&a)!= EOF)
	{
		for (i = 1;; i++)
		{
			if (i*i > a) {
				b = i - 1; break;
			}
		}
		printf("%d", b*b);
	}
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
int main(){

    long long n, i = 0; cin >> n;

    while( i*i <= n ){
        i++;
    }
    i--;
    cout << i*i << '\n';

}
//  [cpp]
#include<bits/stdc++.h>
#include<vector>

#define pb push_back
#define rep(i, a, n) for(int (i)=a; (i)<(n); (i)++)
#define FOR(i, n) rep(i, 0, n)
#define F(n) FOR(i, n)
#define FF(n) FOR(j, n)
#define repi(i, a, n) for(int (i)=a; (i)<=(n); (i)++)
#define FORI(i, n) repi(i, 1, n)
#define FI(n) FORI(i, n)
#define FFI(n) FORI(j, n)
#define IN(x) int x; cin>>(x);
#define SIN(x) string x; cin>>x;
#define INN(x, y) int x, y; cin>>(x)>>(y);
#define INFO(a) cout<<"info "<<a<<endl
#define vi vector<int>
#define vll vector<ll>
#define pii pair<int, int>
#define vpii vector<pair<int, int> >
#define sortv(x) sort((x).begin(), (x).end())
#define sortvd(x) sort((x).begin(), (x).end(), greater<int>())
#define lboundv(x,v) lower_bound((x).begin(),(x).end(),(v))-(x).begin();
#define uboundv(x,v) upper_bound((x).begin(),(x).end(),(v))-(x).begin();
#define ite iterator
#define fi first
#define se second
#define mems(a, v) memset((a), (v), sizeof((a)))
#define lmid(l, r) ((l)+(r)-1)/2
#define rmid(l, r) ((l)+(r))/2+1
#define mp make_pair

typedef long long ll;
typedef long double LD;

using namespace std;

int main() {
	ios::sync_with_stdio(0);
	IN(n);
	cout<<(int) pow(((int) sqrt(n)), 2)<<endl;
	return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;

int main(){
  int n;
  cin >> n;
  int i = 1;
  while(i*i < n){
    ++i;
  }
  --i;
  cout << i*i;
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int i,n,a;
    cin>>n;
    for(i=n;i>=1;i--)
    {
        a=sqrt(i);
        if(i%a==0)
        {
            cout<<i<<endl;
            return 0;
        }
    }
}
//  [cpp]
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;

int main() {
  ll N;
  cin >> N;

  ll ans = 0;
  while (ans * ans <= N) ans++;
  cout << pow(ans - 1, 2) << endl;
  return 0;
}
//  [c]
//set many funcs template
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<stdbool.h>
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384

int max(int a,int b){if(a>b){return a;}return b;}
int min(int a,int b){if(a<b){return a;}return b;}
int zt(int a,int b){return max(a,b)-min(a,b);}
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int ceil(int a,int b){if(a%b==0){return a/b;}return (a/b)+1;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;}
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;}
int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
long long llmax(long long a,long long b){if(a>b){return a;}return b;}
long long llmin(long long a,long long b){if(a<b){return a;}return b;}
long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;}
long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;}
long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;}
long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
double dbmax(double a,double b){if(a>b){return a;}return b;}
double dbmin(double a,double b){if(a<b){return a;}return b;}
double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);}
int sortfncsj(const void *a,const void *b){if(*(int *)a>*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;}
int sortfnckj(const void *a,const void *b){if(*(int *)a<*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;}
int llsortfncsj(const void *a,const void *b){if(*(long long *)a>*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;}
int llsortfnckj(const void *a,const void *b){if(*(long long *)a<*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;}
int dbsortfncsj(const void *a,const void *b){if(*(double *)a>*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;}
int dbsortfnckj(const void *a,const void *b){if(*(double *)a<*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;}

int main(void){
    int n,l=1,h=40000,t,bt=inf;
    scanf("%d",&n);
    while(l!=h){
        t=(l+h)/2;
        if(t==bt){t++;}
        if((t*t)<=n){l=t;}else{h=t-1;}
        bt=t;
    }
    printf("%d\n",l*l);
    return 0;
}
//  [c]
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>

int main() {

    int n;
    scanf("%d", &n);

    int temp = (int) sqrt(n);

    printf("%d", temp * temp);

    return 0;

}
//  [c]
#include <stdio.h>
int main(){
  int N;
  scanf("%d", &N);
  long long i = 1;
  long long ans = 0;
  while(i * i <= N){
    ans = i * i;
    i++;
  }
  printf("%lld\n", ans);
}
//  [c]
#include<stdio.h>
Int main(){
long int n;
Scanf("%ld",&n);
for(int i=0;i<=n;i++){
if(i*i>=n){
If(i*i==n){
Printf("%ld",i*i);
}
else{
Printf("%ld",(i-1)*(i-1));
}
break
}
}
return 0;
}
//  [c]
#include <stdio.h>
int main(void){
    long long N, i, j;
    int cnt = 1;
    
    scanf("%lld", &N);
    
    for(i = N; i > 0; i--){
        for(j = 0; j < N; j++){
            if(i == j * j){
                printf("%lld\n", i);
                cnt = 0;
                break;
            }
        }
        if(cnt == 0){
            break;
        }
    }
    
}
//  [c]
#include <stdio.h>
int main(){
  int N;
  scanf("%d", &N);
  long long i = 1;
  long long ans = 0;
  while(i * i <= N){
    ans = i * i;
    i++
  }
  printf("%lld\n", ans);
}
//  [javascript]
function myin(){return require("fs").readFileSync("/dev/stdin", "utf8").trim();}
function myout(t){console.log(t);}//standard output
//[no]param
//0:何もしない  1:数値へ変換  2:半角SPで分割  3:改行で分割  4:半角SPで分割し、数値配列へ
//5:改行で分割し、数値配列へ  6:1文字に分割  7:1文字に分割し、数値配列へ
function myconv(i,no){switch(no){case 0:return i;case 1:return parseInt(i);case 2:return i.split(" ");case 3:return i.split("\n");case 4:return i.split(" ").map((a)=>Number(a));case 5:return i.split("\n").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));}}

function Main(input) {
  input = myconv(input,1);
  myout(Math.pow(Math.floor(Math.sqrt(input)),2));
}

Main(myin());
//  [javascript]
"use strict";
const Main = (input) =>{
   let xs = input.trim().split(' ').map(v=>parseInt(v,10));
   let num = Math.sqrt(xs[0]);
   let ans = Math.floor(num);
   console.log(Math.pow(ans,2));
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));
//  [javascript]
function Main(input)
{
  input = input.split("\n");

  var a = parseInt(input[0], 10);
  // for(let i = 1; i <= a; i++)
  // {
  //   if (Math.pow(a, 0.5) % 1 != 0) {
  //     a -= 1;
  //   }else{
  //     console.log(a);
  //     break;
  //   }
  // }
  console.log(Math.pow(parseInt(Math.pow(a, 0.5), 10), 2));



  // console.log('%d', a);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function main(input) {
  input=input.trim();
  var a = parseInt(input.split("\n")[0], 10);
  var i=0
  while(Number.isInteger(Math.pow(a,1/2))==false){
    i++
  }
  console.log(a-i);

}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
function main(input) {
  input=input.trim();
  var a = parseInt(input.split("\n")[0], 10);
  var i=0
  while(Number.isInteger(Math.pow(N,1/2))==false){
    i++
  }
  console.log(a-i);

}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
"use strict";
    
const main = arg => {
    const N = parseInt(arg.split("\n")[0]);
    
    if(N === 1) {
        console.log(1);
        return;
    }
    
    for(let i=0; i<N; i++) {
        if(Math.pow(i, 2) > N) {
            console.log(Math.pow(i-1, 2));
            return;
        }
    }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));