# Difference of Squares Given two integers $a$ and $b$. Calculate $a^2 - b^2$ modulo ($10^6+7$). ## Input format Two non-negative integers $a$ and $b$ not exceeding $10^5$. ## Output format Print one integer - the value of $a^2 - b^2$ modulo ($10^6+7$). ### Sample 1 #### Input ``` 3 2 ``` #### Output ``` 5 ``` ### Sample 2 #### Input ``` 1000 1001 ``` #### Output ``` 998006 ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up