Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;

vector <ll> forward;
vector <ll> backward;

int main()
{
	ll i,j,k,l,m = (1000000007),n,r;

	cin >> n >> k;

	// cout << n << '\n';

	forward.push_back(0);
	backward.push_back(0);

	for(i=0;i<=(n);i++)
	{
		forward.push_back(i+forward[i]);
		// cout << forward[i+1] << '\n';
	}

	for(i=(n);i>=0;i--)
	{
		backward.push_back(i+backward[n-i]);

		// cout << backward[n-i+1] << '\n';

	}

	ll t1 = 0,t2 =0;
	j = 0;

	for(i=k;i<=(n+1);i++)
	{
		j += (backward[i]-forward[i]+1);

		

	}

	cout << j%m << '\n';
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: reference to 'forward' is ambiguous
   16 |         forward.push_back(0);
      |         ^~~~~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:61,
                 from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/move.h:84:5: note: candidates are: 'template<class _Tp> constexpr _Tp&& std::forward(typename remove_reference<_Functor>::type&&)'
   84 |     forward(typename std::remove_reference<_Tp>::type&& __t) noexcept
      |     ^~~~~~~
/usr/include/c++/14/bits/move.h:71:5: note:                 'template<class _Tp> constexpr _Tp&& std::forward(typename remove_reference<_Functor>::type&)'
   71 |     forward(typename std::remove_reference<_Tp>::type& __t) noexcept
      |     ^~~~~~~
a.cc:5:13: note:                 'std::vector<long long int> forward'
    5 | vector <ll> forward;
      |             ^~~~~~~
a.cc:21:17: error: reference to 'forward' is ambiguous
   21 |                 forward.push_back(i+forward[i]);
      |                 ^~~~~~~
/usr/include/c++/14/bits/move.h:84:5: note: candidates are: 'template<class _Tp> constexpr _Tp&& std::forward(typename remove_reference<_Functor>::type&&)'
   84 |     forward(typename std::remove_reference<_Tp>::type&& __t) noexcept
      |     ^~~~~~~
/usr/include/c++/14/bits/move.h:71:5: note:                 'template<class _Tp> constexpr _Tp&& std::forward(typename remove_reference<_Functor>::type&)'
   71 |     forward(typename std::remove_reference<_Tp>::type& __t) noexcept
      |     ^~~~~~~
a.cc:5:13: note:                 'std::vector<long long int> forward'
    5 | vector <ll> forward;
      |             ^~~~~~~
a.cc:21:37: error: reference to 'forward' is ambiguous
   21 |                 forward.push_back(i+forward[i]);
      |                                     ^~~~~~~
/usr/include/c++/14/bits/move.h:84:5: note: candidates are: 'template<class _Tp> constexpr _Tp&& std::forward(typename remove_reference<_Functor>::type&&)'
   84 |     forward(typename std::remove_reference<_Tp>::type&& __t) noexcept
      |     ^~~~~~~
/usr/include/c++/14/bits/move.h:71:5: note:                 'template<class _Tp> constexpr _Tp&& std::forward(typename remove_reference<_Functor>::type&)'
   71 |     forward(typename std::remove_reference<_Tp>::type& __t) noexcept
      |     ^~~~~~~
a.cc:5:13: note:                 'std::vector<long long int> forward'
    5 | vector <ll> forward;
      |             ^~~~~~~
a.cc:38:35: error: reference to 'forward' is ambiguous
   38 |                 j += (backward[i]-forward[i]+1);
      |                                   ^~~~~~~
/usr/include/c++/14/bits/move.h:84:5: note: candidates are: 'template<class _Tp> constexpr _Tp&& std::forward(typename remove_reference<_Functor>::type&&)'
   84 |     forward(typename std::remove_reference<_Tp>::type&& __t) noexcept
      |     ^~~~~~~
/usr/include/c++/14/bits/move.h:71:5: note:                 'template<class _Tp> constexpr _Tp&& std::forward(typename remove_reference<_Functor>::type&)'
   71 |     forward(typename std::remove_reference<_Tp>::type& __t) noexcept
      |     ^~~~~~~
a.cc:5:13: note:                 'std::vector<long long int> forward'
    5 | vector <ll> forward;
      |             ^~~~~~~